I'm connecting to a remote MySQL database using this code
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
con = DriverManager.getConnection("jdbc:odbc://kylsoft.thhahost.info/kylsoft_mushnews", "user", "pass");
if (!con.isClosed())
status.setText("Successfully connected to MySQL server");
} catch(Exception e) {
status.setText("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {
status.setText("SQLException: " + e.getMessage());
}
}
I got the "[Microsoft][ODBC Driver Manager] Data source name too long" exception... I did some "research" and apparently... my URL is wrong...
Can sb tell me the right URL syntax?