File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes creating database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "creating database connection" Watch "creating database connection" New topic
Author

creating database connection

Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
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

Joined: Feb 02, 2002
Posts: 1211

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

Joined: Sep 24, 2004
Posts: 22
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

Joined: Feb 02, 2002
Posts: 1211

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

Joined: Oct 25, 2004
Posts: 77
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
 
wood burning stoves
 
subject: creating database connection
 
Similar Threads
App Server Connection Pooling VS User defined Connection Pooling Mechanism
need some help in MVC
connpool_max_limit help
connection pooling thru weblogic 7.0
Linda: Top 10 patterns?