hi, i am noob in java db/ => i have some problems

A

alex.korsak

String connectionDriver = "org.gjt.mm.mysql.Driver";

try {
Class.forName(connectionDriver); // there exc

// Enable logging

Connection connection = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/jabber",
"root", "root");

connection.close();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}

this code throw exception/ what does the bug?
 
M

Manish Pandit

String connectionDriver = "org.gjt.mm.mysql.Driver";

try {
Class.forName(connectionDriver); // there exc

// Enable logging

Connection connection = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/jabber",
"root", "root");

connection.close();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}

this code throw exception/ what does the bug?

What is the exception message and trace?
Are you able to log into local mysql using root/root via the mysql
command line client?
Are you sure the mysql server is running on localhost:3306?

-cheers,
Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top