WAMP MySQL Database access in java code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Srini vas
    New Member
    • Jan 2012
    • 1

    WAMP MySQL Database access in java code

    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!!
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    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.

    Comment

    Working...