aspose file tools*
The moose likes JDBC and the fly likes JAVA JDBC connectivity problem. Kindly see the attached code, Please guide me. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JAVA JDBC connectivity problem. Kindly see the attached code, Please guide me." Watch "JAVA JDBC connectivity problem. Kindly see the attached code, Please guide me." New topic
Author

JAVA JDBC connectivity problem. Kindly see the attached code, Please guide me.

vicky amrev
Greenhorn

Joined: Aug 06, 2012
Posts: 1
JAVA JDBC connectivity problem. I am using MySql database, also I have downloaded and configure JDBC Connector. In the end of this code please see the error that I am getting.
sonu raj
Ranch Hand

Joined: Jul 31, 2012
Posts: 43



Hi vicky,
I copied your code and created a database according to your code and I found two errors.
You have written "com.mysql.Jdbc.Driver". here 'J' of Jdbc should be in lowercase it should be "com.mysql.jdbc.Driver"
vicky amrev wrote:
try{
Class.forName("com.mysql.Jdbc.Driver");


one more mistake you have not mentioned any user name and password in below code, do mention the username and password for your mysql.

conn = DriverManager.getConnection(
"jdbc:mysql://vicky-PC/student");
rs = conn.createStatement().executeQuery("select * from student");


It should be DriverManager.getConnection("jdbc:mysql://vicky-PC/student","root","password"); here root is default username for mysql and enter the password set while installing it.
Rest of the code is Correct. All the best!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA JDBC connectivity problem. Kindly see the attached code, Please guide me.
 
Similar Threads
error during batch update
Database Connection
unable to run this program
JDBC Eclipse mySQL
No suitable driver error.