Solved

SQLSERVER JDBC Type 3 Driver issue

Posted on 2010-11-19
30
649 Views
Last Modified: 2012-05-10
Hi,
I have written one applicating using JDBC Type 3 SQLSERVER driver. The application is running fine when I run it from command prompt and retriving the data from remote data base. When I am trying to run the application from JNLP the form is opening but when trying to retrive the records from database, system doesn't do any thing. I am unable to trace the problem in java application. System is throwing exception "No suitable driver found for jdbc:sqlserver"

Please Help.

Regards
0
Comment
Question by:MILIND_JOG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 16
  • 8
  • 3
  • +1
30 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 34171908
Open the Java Console and turn the trace value up. Post what you find
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 34171936
you need to add the driver jars to your jnlp and make them available to be downloaded

if you're accessing a database on a different server then you'll also need to sign your jars and update the jnlp
0
 

Author Comment

by:MILIND_JOG
ID: 34171947
Hi CEH,

Thanks for the responce. I am a new person in JAVA. I do not know fronm where to turn on the trace. I will appreciate you if you guide me to on the trace.

Regards

Milind
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:MILIND_JOG
ID: 34171975
Hi objects,

Thanks for the responce. I have downloaded sqljdbc4 from MS site. The Java application is running fine from command prompt and retriving the data. When I am lonching through JNLP it is creating problem of NO Suitable Driver.

I am a new person in JNLP. I will appreciate you if you please guide me how to add driver jar file for download in JNLP.

Regards

Milind
0
 
LVL 92

Expert Comment

by:objects
ID: 34171996
you need to add a jar element to the resources section

http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html
0
 

Author Comment

by:MILIND_JOG
ID: 34172013
objects:

I have added in resource section of jnlp. I got the following error

My JNLP is :

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="LeaveMgmt.jnlp">
      <information>
            <title>Jnlp Testing</title>
            <vendor>YONG MOOK KIM</vendor>
            <homepage href="http://localhost:8080/" />
            <description>Testing Testing</description>
      </information>
      <security>
            <all-permissions/>
      </security>
      <resources>
            <j2se version="1.6+" />
            <jar href="sqljdbc4.jar" />
            <jar href="LeaveSys.jar" />
      </resources>
      <application-desc main-class="LeaveSys.LeaveSys" />
</jnlp>

ERROR is
JNLPException[category: Launch File Error : Exception: null : LaunchDesc:
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="http://localhost:8080/LeaveMgmt.jnlp">
  <information>
    <title>Jnlp Testing</title>
    <vendor>YONG MOOK KIM</vendor>
    <homepage href="http://localhost:8080/"/>
    <description>Testing Testing</description>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="timeout" policy="always"/>
  <resources>
    <java version="1.6+"/>
    <jar href="http://localhost:8080/sqljdbc4.jar" download="eager" main="false"/>
    <jar href="http://localhost:8080/LeaveSys.jar" download="eager" main="false"/>
  </resources>
  <application-desc main-class="LeaveSys.LeaveSys"/>
</jnlp> ]
      at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
      at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.launch(Unknown Source)
      at com.sun.javaws.Main.launchApp(Unknown Source)
      at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
      at com.sun.javaws.Main$1.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34172230
Did you put those jars in the right directory?
0
 

Author Comment

by:MILIND_JOG
ID: 34172309
I put the sqljdbc4.jar in root directory

Milind
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 250 total points
ID: 34172316
Both need to be in the directory that's your web root
0
 

Author Comment

by:MILIND_JOG
ID: 34172361
Yes. Both jar is in web root.
0
 

Author Comment

by:MILIND_JOG
ID: 34172368
I have developed the JAVA application using FRAME. It is not Applet.

Milind
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34172369
Open up the Java Contol Panel in Windows Control Panel and set the Console to be visible
0
 

Author Comment

by:MILIND_JOG
ID: 34172388
The ERROR Appairing is
JAR Resource in JNLP file are not signed by same certificate

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34172400
>>I have developed the JAVA application using FRAME. It is not Applet.

Yes, i'm aware of that. It has no bearing on checking the Java console
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34172409
With that type of driver, you shouldn't need to sign the applet at all, as long as the host being connected to by the driver is the same host as the one where the app originates
0
 

Author Comment

by:MILIND_JOG
ID: 34172422
I made the changes in Java Console visible
0
 

Author Comment

by:MILIND_JOG
ID: 34172432
I made the Java Console visible
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34172456
Please post trace and see my comment at

http:#34172409
0
 

Author Comment

by:MILIND_JOG
ID: 34172473
Java Web Start 1.6.0_21
Using JRE version 1.6.0_21-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Milind Jog
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
#### Java Web Start Error:
#### JAR resources in JNLP file are not signed by same certificate
0
 

Author Comment

by:MILIND_JOG
ID: 34172554
If I remove the sqljdbc4.jar from resource then I got the following error.



Java Web Start 1.6.0_21
Using JRE version 1.6.0_21-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Milind Jog
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at LeaveSys.FormUtilityOrg$OrgItemH.actionPerformed(FormUtilityOrg.java:141)
      at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
      at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
      at java.awt.Component.processMouseEvent(Unknown Source)
      at javax.swing.JComponent.processMouseEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
No suitable driver found for jdbc:sqlserver://leave.avtec.in:1433;databaseName=XXXXXX;user=XXXXXX;password=XXXXXX;
0
 

Author Comment

by:MILIND_JOG
ID: 34172721
Hi
The problem is solved

Milind
0
 

Author Comment

by:MILIND_JOG
ID: 34172802
Dear CEH

Under your guidence the problem is solved. I am now relived from the network frunt. Now I may focus in application inhancement. I really appreciate your efforts in resolving the issue. The probelem was at JARsignature. One application jar file has signature while sqljdbc.jar had no signature . I made comman signature for both and problem resolved.

Thanks Once again.

Warm Regards

Milind
0
 
LVL 92

Expert Comment

by:objects
ID: 34177227
good to see you got it working
as I mentioned in my earlier comment you need to sign all jars (with same certificate)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34177504
>> I really appreciate your efforts in resolving the issue.

So much so that you've decided to award me zero points ;)
0
 

Author Comment

by:MILIND_JOG
ID: 34179236
Hi

I sorry CEH. Where to allot the points?? I really do not know. Please let me know , I will 100% award you maximum points.

Regards

Milind
0
 

Author Comment

by:MILIND_JOG
ID: 34179242
Hi CEH.

I want to award points to both you and object. Please help me from where to award the points.

Warm Regards

Milind
0
 

Author Comment

by:MILIND_JOG
ID: 34608438
Thanks for the solution.

It helped me a lot in resolving the issue.

Regards

Milind
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37445788
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Format Date fields 11 54
Need help aligning JRadioButton that put in a box using GridBagLayout 2 37
Find unused columns in a table 12 88
Reverse Proxy problem 3 30
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question