User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 456,571 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,617 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 3049 | Replies: 7
Reply
Join Date: Oct 2007
Posts: 13
Reputation: nikhita is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
nikhita nikhita is offline Offline
Newbie Poster

Solution how to update database using mysql and jsp

  #1  
Oct 26th, 2007
can somebody prove me the coding to update the database (mysql) with JSP
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,629
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 12
Solved Threads: 311
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: how to update database using mysql and jsp

  #2  
Oct 29th, 2007
Google is your friend! There are many examples over the internet, for example this site http://www.java2s.com/Tutorial/Java/...__Database.htm
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
Reply With Quote  
Join Date: Nov 2007
Posts: 7
Reputation: Shubhra is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shubhra Shubhra is offline Offline
Newbie Poster

Re: how to update database using mysql and jsp

  #3  
Nov 2nd, 2007
U can write all code using scriptlet. Simply start scriptlet,create connection, write and execute update query, close connection and scriptlet.
For Ex
<%
create connection
Create query
resultset
execute query
close connection
%>
Hope it provides u some help!!

U can find example code in google.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,517
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is online now Online
Posting Virtuoso

Re: how to update database using mysql and jsp

  #4  
Nov 2nd, 2007
Originally Posted by Shubhra View Post
U can write all code using scriptlet. Simply start scriptlet,create connection, write and execute update query, close connection and scriptlet.
For Ex
<%
create connection
Create query
resultset
execute query
close connection
%>
Hope it provides u some help!!

U can find example code in google.


Which is, of course, exactly the wrong way to do it, reagardless of whether it works or not.

You can also scratch your back with a butcher knife, but I wouldn't suggest it.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Nov 2007
Posts: 7
Reputation: Shubhra is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shubhra Shubhra is offline Offline
Newbie Poster

Re: how to update database using mysql and jsp

  #5  
Nov 2nd, 2007
Ya OK.
What I provided was actually the short cut.
Correct way is to do all such stuff in class. Create object in jsp and simply execute the method!!

Am I correct now??
Reply With Quote  
Join Date: Feb 2006
Posts: 1,517
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is online now Online
Posting Virtuoso

Re: how to update database using mysql and jsp

  #6  
Nov 2nd, 2007
Well, if you knew the right way, why did you suggest the wrong way?

As I said:

You can also scratch your back with a butcher knife, but I wouldn't suggest it.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Nov 2007
Posts: 7
Reputation: Shubhra is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shubhra Shubhra is offline Offline
Newbie Poster

Re: how to update database using mysql and jsp

  #7  
Nov 2nd, 2007
Actually I wrote what came first to my mind.
Your comment stroke me to give a2nd thought.
I apologise.
Reply With Quote  
Join Date: Oct 2007
Posts: 13
Reputation: nikhita is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
nikhita nikhita is offline Offline
Newbie Poster

Help how make a jsp page printer friendly

  #8  
Nov 7th, 2007
the link you provided was helpful. thanks a lot.

sorry for the delay in reply..

One more help needed....

can u tel me how make a jsp page printer friendly
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 6:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC