Solved

SQLSERVER JDBC Type 3 Driver issue

Posted on 2010-11-19
30
614 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
  • 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
 

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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 26

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now