When I try something like this:
Class.forName("com.mysql.jdbc.Driver").newInstance();
DriverManager.getConnection("jdbc:mysql://192.168.2.116:3306/SocialFamilyTree");
I get an error:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Tried:
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
DriverManager.getConnection("jdbc:sqlserver://localhost:1433");
}catch(Exception e){
System.out.println("Couldn't get database connection.");
e.printStackTrace();
}
and got:
Couldn't get database connection.
Oct 06, 2012 11:15:37 PM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>