Skip to main content

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.Friend
Messages: 6
Registered: January 2012
Junior Member
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:
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(
at vocab.TestMain.main(

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.

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 HerrmannFriend
Messages: 1828
Registered: July 2009
Senior Member
Please use this forum only for questions relating to the Eclipse Java Development Tools,
Previous Topic:Question about Java Compiling
Next Topic:Invisible Eclipse editor
Goto Forum:

Current Time: Mon Nov 30 00:01:41 GMT 2020

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

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

Back to the top