Results 1 to 12 of 12
Thread: Problem in JDBC
- 07-01-2008, 06:42 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 83
- Rep Power
- 0
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)
- 07-01-2008, 08:26 AM #2
Senior Member
- Join Date
- May 2008
- Location
- Makati, Philippines
- Posts
- 234
- Rep Power
- 6
have added those jar file in the
..\Java\jdk1.6.0_05\jre\lib\ext\ FolderMind only knows what lies near the heart, it alone sees the depth of the soul.
- 07-01-2008, 08:58 AM #3
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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.
- 07-01-2008, 09:03 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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.
- 07-01-2008, 09:14 AM #5
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 JDBCTo finish sooner, take your own time....
Nivedithaaaa
- 07-01-2008, 02:02 PM #6
Member
- Join Date
- Jun 2008
- Posts
- 1
- Rep Power
- 0
Hi,
You might have missed out some .jar files to be included. Try to add its corresponding jar files and then try out.
- 07-01-2008, 02:14 PM #7
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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 02:17 PM.
- 07-02-2008, 01:39 PM #8
Member
- Join Date
- Jul 2008
- Posts
- 1
- Rep Power
- 0
for using sqlserver type 4 database you have to download 3 jar files.and keep it in lib folder before running your web application
- 07-02-2008, 05:37 PM #9
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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".
- 01-08-2009, 06:46 AM #10
Member
- Join Date
- Jan 2009
- Posts
- 2
- Rep Power
- 0
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.
- 01-08-2009, 08:20 AM #11
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Start your own thread, don't hijack another.
- 01-08-2009, 05:18 PM #12
Member
- Join Date
- Jan 2009
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Jdbc problem
By abhiN in forum JDBCReplies: 1Last Post: 03-21-2008, 05:10 AM -
Problem in Servlet with JDBC
By *New Programer* in forum Java ServletReplies: 2Last Post: 12-20-2007, 09:15 AM -
JDBC problem
By Swamipsn in forum New To JavaReplies: 1Last Post: 08-13-2007, 06:05 PM -
JDBC Driver problem
By Swamipsn in forum New To JavaReplies: 3Last Post: 08-09-2007, 03:55 PM -
JDBC problem
By peiceonly in forum Threads and SynchronizationReplies: 2Last Post: 08-03-2007, 01:42 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks