File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes connection of eclipse helios and mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connection of eclipse helios and mysql" Watch "connection of eclipse helios and mysql" New topic
Author

connection of eclipse helios and mysql

Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446
    
    1

Hello
I am new to database connectivity and eclipse too
from this link I understood how to connect to mysql database

but when I create my own database in mysql, I am not able to connect to it through eclipse

but I am able to connect to the default "mysql" database

I have not made silly mistakes in typing wrong database and all that
even when I write show databases command on the mysql prompt
my database is not appearing but I have actually created and can view it through the MySQL workbench



is this issue with the user permissions?
as I have not created any user and used mysql prompt directly after installation without changes in user


what can be the problem?
please help
I am eager to learn the database connectivity through jsp and servlets

SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Hi,

Do you get an error message?

Can you provide the connection details you give in Eclipse, and in the WorkBench?


OCUP UML fundamental and ITIL foundation
youtube channel
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446
    
    1

When I am trying to connect through eclipse, it is ok for the "mysql" database
details are:
Database: mysql
URL: jdbc:mysql//localhost:3306/mysql
username:root

and connection test is succeeded
but I created another database called OCPJP_simulator
and details are
Database: OCPJP_simulator
URL:jdbc://mysql//localhost:3306/OCPJP_simulator
username:root


the error message when trying to test connection is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'ocpjp_simulator'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2312)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2122)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:213)
at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)
at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:73)
at org.eclipse.datatools.enablement.internal.mysql.connection.JDBCMySQLConnectionFactory.createConnection(JDBCMySQLConnectionFactory.java:28)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:358)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)







 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connection of eclipse helios and mysql