I'm having trouble trying to connect to my online MySQL database. I'm willing to pay someone in FG to send me the java code for a working version. The end game of the program is to create new users, look up users in the database and store a small bit of info on the person. So to break it down even more:
- connect to my database online
- be able to search for people in the database
- be able to create a new user in the database
- be able to store small amount of info on the user
I'm mainly concerned with trying to connect to my database online. Here's what I have tried:
Code
String url="jdbc:mysql://102.0.0.1:3306/kellysco";
String username="myusername"; String password="mypassword";
System.out.println("Connecting to database...");
try (Connection connection=DriverManager.getConnection(url,username,password))
{
System.out.println("Database connected!");
}catch (SQLException e)
{
throw new IllegalStateException("Cannot conncect to database!", e);
}