I'm trying to access phpMyAdmin data base from java plug-in project. I have added mysql-connector-java-5.0.8-bin.jar to the external jar files of the project and following is the connection string I use to access the database:
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
String link= "jdbc:odbc:https://just36.justhost.com:2083:databaseName=xxxx";
private static String userName = "xxxx";
private static String password = "xxxx";
Connection conn = DriverManager.getConnection(link, userName, password);
The URL, database name, username and password are correct. But this code gives following error.
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at vocab.ITSVocabulary.ReadTextInput(ITSVocabulary.java:27)
at vocab.TestMain.main(TestMain.java:23)
Line 27: Connection conn = DriverManager.getConnection(url, userName, password);
I checked the related posts to this problem and set the classpath variable for this JAR file too. Before this, I tried mysql-connector-java-5.1.22.jar, it also didn't work. Do I need to set any class paths, or change any network setting here? I'm really grateful if someone can tell me is there anything wrong with this procedure or what I missed.
Thanks.