Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating database connection

 
Sajan Patel
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI everyone,
I am using Novell ExteNd. it has inbuild MySql (open source). I am trying to get connection.

DriverManager.getConnection("jdbc:mysql://localhost:63306/SilverMaster50", "username", "password");

But somehow it is not working and giving me error Suitable driver not found.

I would like to know is there any thing we have to set before execute like class path or something or instead of above syntax i should use something else.






Thanks in advance

Sajan
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that the jar file containing the MySQL driver is on classpath, and load the driver class using Class.forName() before you attempt to open a connection.

HTH
 
Priyadharshini Nagarajan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sample Code

Class.forName("jdbc dbc:M-Sql driver");

DriverManager.getConnection("jdbc:mysql://localhost:63306/SilverMaster50", "username", "password");


Regards
Priya

[edited to disable smilies]
[ October 27, 2004: Message edited by: Jeanne Boyarsky ]
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Priyadharshini Nagarajan:

Class.forName("jdbcdbc:M-Sql driver");


It should be Class.forName(<fully qualified driver class name>).
You are probabely specifying the JDBC url there.

cheers
 
Sajan Patel
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all your help. But still it is not working I tried with Class.___. Some of my co-worker says it may be because WSAD which we use for development. But Now I decide to use development database instead of My-SQL

Thanks
Sajan Patel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic