aspose file tools*
The moose likes JDBC and the fly likes not able to connect to the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "not able to connect to the database" Watch "not able to connect to the database" New topic
Author

not able to connect to the database

Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

got the following error when i try to run java program
Error


Here is the program


here is the classpath


any idea what is the problem
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3825

When you are using "-cp" switch the "CLASSPATH" environment variable will be ignored, to use the values contained within that you should add that to the "-cp" switch as well. java -cp $CLASSAPTH;. MysqlConnect

P.S:I'm not sure about the delimiter (i.e ; or :).


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

thanks for your reply and got the error which says
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3825

bash-3.2# java -cp $CLASSPATH MysqlConnect

This should include the directory your class resides as well (this case I think current directory?). Try "java -cp $CLASSPATH;. MysqlConnect" OR "java -cp $CLASSPATH:. MysqlConnect"
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

thats great...thanks Vijitha Kumara it working thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to connect to the database