• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC MYSQL

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we use following string in jsp/java code to connect to oracle

code
____________________________________________________________
String url = "jdbc :0racle:thin:@127.0.0.1:1521 :0racleSID";
----------------------------------------------------------------

what code/string is used for MySql and which drivers are required for mysql

pls help
[ July 27, 2004: Message edited by: nirail rail ]
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I've done this, and I'm sure I got the complete information from mysql.org. Also, there are a bunch of tutorials out there. Google search = java jdbc mysql driver try. The try will probably garuntee you a code example . Happy hunting. Prem
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used the one found at:

Unpack the .jar file and make sure it is included in your CLASSPATH.

Load the driver with:
Class.forName("com.mysql.jdbc.Driver").newInstance();
and get a connection with something like:
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=");
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just for the record, you only need to put .instance() if you're using Java 1.1 or earlier, otherwise Class.forName(...) will be enough.

Only a small point and hardly worth mentioning, but sometimes its nice to know. It could save you from creating one whole instance

Dave
 
reply
    Bookmark Topic Watch Topic
  • New Topic