Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Error Logging in to the database(Eclipselink error)
Error Logging in to the database [message #521873] Fri, 19 March 2010 04:19 Go to next message
bob is currently offline bobFriend
Messages: 8
Registered: March 2010
Junior Member
Hello,

I'm using eclipse link (OSGI version) and MySQL Connector/J
to connect to MySQL database.

And i keep getting this error:

Quote:
The class com.mysql.jdbc.Driver was not found please ensure the JDBC driver is on the system classpath


To Fix it I added
    C:\eclipselink\mysql-connector-java-5.1.12\mysql-connector-j ava-5.1.12-bin.jar

to the CLASSPATH in system variable (Windows 7)



and also I added:
   DRIVER_CLASSPATH=C:\eclipselink\mysql-connector-java-5.1.12\ mysql-connector-java-5.1.12-bin.jar

to setenv.cmd file in eclipselink>bin folder



Also I added
   C:\eclipselink\mysql-connector-java-5.1.12\mysql-connector-j ava-5.1.12-bin.jar

in General tab of the eclipselink



the Driver class is also set to com.mysql.jdbc.Driver

Still i get the same error when I want to log in to database!!!! Shocked

I appreciate any help to solve this problem.

thank-abu

Here is the setenv.cmd content:

@REM User MUST set DRIVER_CLASSPATH to point to their desired driver jar(s), such as JDBC and J2C.  For example:
@REM  DRIVER_CLASSPATH=c:\some_dir\jdbc\ojdbc14.jar;c:\some_other_ dir\j2c\aqapi.jar
@REM 
@REM Note: DRIVER_CLASSPATH should NOT contain any classes for your persistent business objects - these are 
@REM configured in the Mapping Workbench project.

@REM User MUST set JAVA_HOME to point a supported JRE. If none
@REM is provided for INSTALL_JAVA_HOME then the system JAVA_HOME
@REM value will be used
set INSTALL_JAVA_HOME=%s_jreDirectory%
if "%JAVA_HOME%"=="" (
    set JAVA_HOME=%INSTALL_JAVA_HOME%
)

 DRIVER_CLASSPATH=C:\eclipselink\mysql-connector-java-5.1.12\ mysql-connector-java-5.1.12-bin.jar

@REM Please do not change any of the following lines:

set _FIXPATH=
call :fixpath "%DRIVER_CLASSPATH%"
set DRIVER_CLASSPATH=%_FIXPATH:~1%
set _FIXPATH=
call :fixpath "%JAVA_HOME%"
set JAVA_HOME=%_FIXPATH:~1%
goto :EOF

:fixpath
if not %1.==. (
  for /f "tokens=1* delims=;" %%a in (%1) do (
    call :shortfilename "%%a" & call :fixpath "%%b"
  )
)
goto :EOF
:shortfilename
for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
goto :EOF

[Updated on: Fri, 19 March 2010 12:21]

Report message to a moderator

Re: Error Logging in to the database [message #522101 is a reply to message #521873] Sat, 20 March 2010 00:16 Go to previous messageGo to next message
bob is currently offline bobFriend
Messages: 8
Registered: March 2010
Junior Member
abu wrote on Fri, 19 March 2010 00:19
Hello,

I'm using eclipse link (OSGI version) and MySQL Connector/J
to connect to MySQL database.

And i keep getting this error:

Quote:
The class com.mysql.jdbc.Driver was not found please ensure the JDBC driver is on the system classpath


To Fix it I added
    C:\eclipselink\mysql-connector-java-5.1.12\mysql-connector-j ava-5.1.12-bin.jar

to the CLASSPATH in system variable (Windows 7)



and also I added:
   DRIVER_CLASSPATH=C:\eclipselink\mysql-connector-java-5.1.12\ mysql-connector-java-5.1.12-bin.jar

to setenv.cmd file in eclipselink>bin folder



Also I added
   C:\eclipselink\mysql-connector-java-5.1.12\mysql-connector-j ava-5.1.12-bin.jar

in General tab of the eclipselink



the Driver class is also set to com.mysql.jdbc.Driver

Still i get the same error when I want to log in to database!!!! Shocked

I appreciate any help to solve this problem.

thank-abu

Here is the setenv.cmd content:

@REM User MUST set DRIVER_CLASSPATH to point to their desired driver jar(s), such as JDBC and J2C.  For example:
@REM  DRIVER_CLASSPATH=c:\some_dir\jdbc\ojdbc14.jar;c:\some_other_ dir\j2c\aqapi.jar
@REM 
@REM Note: DRIVER_CLASSPATH should NOT contain any classes for your persistent business objects - these are 
@REM configured in the Mapping Workbench project.

@REM User MUST set JAVA_HOME to point a supported JRE. If none
@REM is provided for INSTALL_JAVA_HOME then the system JAVA_HOME
@REM value will be used
set INSTALL_JAVA_HOME=%s_jreDirectory%
if "%JAVA_HOME%"=="" (
    set JAVA_HOME=%INSTALL_JAVA_HOME%
)

 DRIVER_CLASSPATH=C:\eclipselink\mysql-connector-java-5.1.12\ mysql-connector-java-5.1.12-bin.jar

@REM Please do not change any of the following lines:

set _FIXPATH=
call :fixpath "%DRIVER_CLASSPATH%"
set DRIVER_CLASSPATH=%_FIXPATH:~1%
set _FIXPATH=
call :fixpath "%JAVA_HOME%"
set JAVA_HOME=%_FIXPATH:~1%
goto :EOF

:fixpath
if not %1.==. (
  for /f "tokens=1* delims=;" %%a in (%1) do (
    call :shortfilename "%%a" & call :fixpath "%%b"
  )
)
goto :EOF
:shortfilename
for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
goto :EOF




I solved it !

I missed set in setenv.cmd .

I do not know how to mark this topic as solved in this forum?
Re: Error Logging in to the database [message #522112 is a reply to message #522101] Sat, 20 March 2010 06:05 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
> I do not know how to mark this topic as solved in this forum?

You don't. This is not a forum but a newsgroup; it's just for exchanging messages.
Re: Error Logging in to the database [message #522138 is a reply to message #522112] Sat, 20 March 2010 11:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Actually it's both a forum and a newsgroup depending on how you access it...

Generally folks will change the subject line to prefix it with [Solved]
or something like that, along with a post of their solution in the body.


tbee wrote:
>> I do not know how to mark this topic as solved in this forum?
>
> You don't. This is not a forum but a newsgroup; it's just for
> exchanging messages.
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Marshalling attributes as node, why ?
Next Topic:Private Ownership and Unique Constraints
Goto Forum:
  


Current Time: Wed Apr 24 20:27:31 GMT 2024

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

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

Back to the top