SCJP 5
srinivas srinivasmeenavalli wrote:Issue with com.mysql.jdbc.Driver classpath and Jar file.
MQSQL Driver class has to be in class path while executing your JDBC program.
Java databse connectivity jar contains interfaces like statement ,result set etc.
Each vendor will provide own implementation of JDBC . To execute oracle jdbc program you need to have jar file from oracle.
as i know above statment applies all of the databases.
here solutio is you have to include MQSQL Jar file in the classpath. Which IDE you are using ?
MYSQL Jar
All the Best
SCJP 5
teja dharma wrote: ...at compile time no error but at run time i am getting nullpoinerexception
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara wrote:
teja dharma wrote: ...at compile time no error but at run time i am getting nullpoinerexception
Did you use the same set of required entries in the CLASSPATH when running as with compiling? Can you post the full stack trace?
SCJP 5
teja tej wrote:At runtime java jdbcdemo :
![]()
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara wrote:
teja tej wrote:At runtime java jdbcdemo :
![]()
No, you should provide the same set of jars used to compile when running too ("java -cp <setofJARs> classname").
SCJP 5
teja tej wrote:At runtime I gave the command java -cp "C:\Documents and Settings\teja\MyDocuments\mysql-connector-java-5.1.10\mysql-connector-java-5.1.10.jar" jdbcdemo
This time i got java.lang.NoClassDefFoundError:jdbcdemo
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Don't get me started about those stupid light bulbs. |