Results 1 to 12 of 12

Thread: Problem in JDBC

  1. #1
    Preethi is offline Member
    Join Date
    Jan 2008
    Posts
    83
    Rep Power
    0

    Default Problem in JDBC

    I'm getting this erro only after downloading JDBC Driver for sqlserver2005.
    Can anyone say me how to remove it or how to solve the problem.(I have searched for it in add or remove
    programs in control panel,but couldn't find...But i have included mssqlserver.jar,msutil.jar,msbase.jar in my classpath)

    Java Code:
    basic: Modality pushed
    basic: Modality popped
    basic: Registered modality listener
    liveconnect: Invoking JS method: document
    liveconnect: Invoking JS method: URL
    basic: Referencing classloader: sun.plugin.ClassLoaderInfo@15efa6a, refcount=1
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter@14b389
    basic: Loading applet ...
    basic: Initializing applet ...
    basic: Starting applet ...
    java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    	at sun.applet.AppletClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.applet.AppletClassLoader.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 xmlTrail.XMLReading.fileParsing(XMLReading.java:86)
    	at xmlTrail.MD2$Imagepanel.prepareData(MD2.java:517)
    	at xmlTrail.MD2$Imagepanel.<init>(MD2.java:139)
    	at xmlTrail.MD2.init(MD2.java:56)
    	at sun.applet.AppletPanel.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\Documents and Settings\com\microsoft\sqlserver\jdbc\SQLServerDriver.class (The system cannot find the path specified)
    	at java.io.FileInputStream.open(Native Method)
    	at java.io.FileInputStream.<init>(Unknown Source)
    	at java.io.FileInputStream.<init>(Unknown Source)
    	at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    	at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    	at sun.applet.AppletClassLoader.access$100(Unknown Source)
    	at sun.applet.AppletClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)

  2. #2
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Default

    have added those jar file in the
    ..\Java\jdk1.6.0_05\jre\lib\ext\ Folder
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  3. #3
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by Eku View Post
    have added those jar file in the
    ..\Java\jdk1.6.0_05\jre\lib\ext\ Folder
    DON'T add it there. Never add anything to the jre lib directories. That ext folder is for language extensions (the meaning of ext) and a JDBC Driver is far from a language extension. Besides, what happens when you upgrade Java? What happens, when for one app you need a newer version of a Driver, and for an older app you need an older version?

    Add the jarfile to your CLASSPATH (not your system classpath as the older/newer version problem still exists there, and most web containers and IDE's won't use that anyway), but rather, if you are using a jarfile, to the manifest, and if you are not using a jarfile, to the command line -cp option, or if you are using a web container/IDE configure it there.

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Ach, and your problem is that you're using an applet. In that case you must provide the Driver classes yourself (unpacked form in the "codebase" directory, or in the jarfile if using a jarfile) or, make url (or RMI or someother remote protocol) to a self-written server that will interface with the db for you and just send you the results.

  5. #5
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    7

    Default

    I think it ll be in "SQL-Installation path/Lib", correct me if ia m wrong.
    Check this too
    HOW TO: Get Started with Microsoft JDBC
    To finish sooner, take your own time....
    Nivedithaaaa

  6. #6
    AnilKanike is offline Member
    Join Date
    Jun 2008
    Posts
    1
    Rep Power
    0

    Default

    Hi,

    You might have missed out some .jar files to be included. Try to add its corresponding jar files and then try out.

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    To both of the last posters. He is using an Applet. That means that the application itself will be running on a client machine that he may (and probably should) have no control over. That he means, whatever he writes will have access to core java, and core java, only, unless he provides it from the "codebase" he defines in the Applet tag.

    @OP: Make sure the Driver is freely distributable, though, otherwise you will be violating license restrictions, and that could become very costly in terms of both money (fines) and time (prison).
    Last edited by masijade; 07-01-2008 at 03:17 PM.

  8. #8
    rajeshbehera is offline Member
    Join Date
    Jul 2008
    Posts
    1
    Rep Power
    0

    Default

    for using sqlserver type 4 database you have to download 3 jar files.and keep it in lib folder before running your web application

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    It's not a web application. It's an applet, so he must provide all three of those jarfiles (in unpacked format, as already noted) as part of the "codebase".

  10. #10
    sofia is offline Member
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default I am new to Java Forums

    I need some help with connecting to oracle database. I had a java application which has a servelt and a java class that does the connection to Oracle (thin) and another Java Bean class that process the result statement and the index.jsp that display the returned information. The application worked well but we noticed that the Oracle server crashed after like 80 requests, we noticed that the connection wasn't closing eventhough I have the Close method called to close the connection.
    Can you please help me figure out what is the right way to connect to Oracle, my application is used by almost 700 people almost every day.
    Let me know if you need me to post any code.

  11. #11
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Start your own thread, don't hijack another.

  12. #12
    sofia is offline Member
    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0

    Default well, sorry didn't mean to do this

    this is my first time on this forum.

Similar Threads

  1. Jdbc problem
    By abhiN in forum JDBC
    Replies: 1
    Last Post: 03-21-2008, 06:10 AM
  2. Problem in Servlet with JDBC
    By *New Programer* in forum Java Servlet
    Replies: 2
    Last Post: 12-20-2007, 10:15 AM
  3. JDBC problem
    By Swamipsn in forum New To Java
    Replies: 1
    Last Post: 08-13-2007, 07:05 PM
  4. JDBC Driver problem
    By Swamipsn in forum New To Java
    Replies: 3
    Last Post: 08-09-2007, 04:55 PM
  5. JDBC problem
    By peiceonly in forum Threads and Synchronization
    Replies: 2
    Last Post: 08-03-2007, 02:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •