• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MySQL DataBase

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,
I had wrote a programe for establish a connection MySql database using JDBC. My Programming code is



When i was run this programme it is displaying as


Copyright 2004, R.G.Baldwin
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at JdbcConnection.main(JdbcConnection.java:11)
Cannot connect to database server

I am setting the CLASS PATH is "C:\Program Files\Java\jdk1.5.0\jre\lib\MYSQL.jar;C:\Program Files\Java\jdk1.5.0\jre\lib\mysql-connector-java-5.0.8-bin.jar;"

Could you know where i did a mistake. Please tell me.
[ March 04, 2008: Message edited by: Ulf Dittmer ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dows it work if you add the jar file on the command line, like


[ March 04, 2008: Message edited by: Ulf Dittmer ]
 
Rajesh Rami Reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Sir.
Now Jdbc Connection is established and perform the Transactions only sample programs.
I am also setting the classpath as you suggested previously in the Environment Variables.
What is the difference bitween setting the class path as command prompt and environment variables in Mycomputer properties in windows mode.

i had never expect raise this type of problams.

Once again Thank you very much.

could you know how to establish a connection pool in tomcat server using hibernate and spring frameworks. The database is Sql Server 2000.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

could you know how to establish a connection pool in tomcat server using hibernate and spring frameworks.


Hibernate can do that using the C3PO pool implementation. Shouldn't take more than the appropriate entries in the hibernate.properties file. See this for further information.
[ March 05, 2008: Message edited by: Ulf Dittmer ]
 
Always! Wait. Never. Shut up. Look at this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic