• Post Reply Bookmark Topic Watch Topic
  • New Topic

mysql connection

 
tny shariff
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all,
i've build a system using mysql and jsp.my problem is i dont know how to connect to mysql through jsp.can anyone helps step by step?thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36031
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you taken a look at Sun's JDBC tutorial?

I should also point out that it is not considered good practice to put JDBC code in a JSP. It is better to put it in a servlet (or class called by the servlet) and redirect to the JSP. This keeps the model and view separate. It's fine if you are just starting out, but do keep this in mind for the future.
 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

whn u want to connect to mysql then create odbc connection

then follow the steps

Class.forName("");
Connection con=DriverManager.getConnection("");

Statement stmt=con.createStatement();


cheers
vasu
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!