Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to connect to the database

 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :).

 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply and got the error which says
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats great...thanks Vijitha Kumara it working thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic