By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

WAMP MySQL Database access in java code

P: 1
I have a public IP system. In that I have installed WAMP. And I have written a java code to establish jdbc connection with the mysql installed in the public ip system.

My Database connection fails miserably,

Connection con = DriverManager
.getConnection("jdbc:mysql://localhost/Test123","usr","123");


If my public ip is example.com, can i try
Connection con = DriverManager
.getConnection("jdbc:mysql://example.com/Test123","usr","123");

Even this fails.

My main problem is I don't know how to establish connection using java code with WAMP MYSQL Database in public ip system.

Please help me!!
Jan 1 '12 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,059
please follow the example found on link

And about connecting from any host read the link

one more this is your mysql server only allow those client that has permission to connect with your mysql server.
Jan 4 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.