Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Accessing phpMyAdmin database though Java
Accessing phpMyAdmin database though Java [message #928488] Sun, 30 September 2012 17:32 Go to next message
Waths B. is currently offline Waths B.
Messages: 6
Registered: January 2012
Junior Member
Hi,
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);

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.
Re: Accessing phpMyAdmin database though Java [message #928634 is a reply to message #928488] Sun, 30 September 2012 20:55 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
Please use this forum only for questions relating to the Eclipse Java Development Tools,
thanks.
Previous Topic:Question about Java Compiling
Next Topic:Invisible Eclipse editor
Goto Forum:
  


Current Time: Fri Oct 31 10:55:50 GMT 2014

Powered by FUDForum. Page generated in 0.07433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software