Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 686
  • Last Modified:

SQLSERVER JDBC Type 3 Driver issue

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
MILIND_JOG
Asked:
MILIND_JOG
  • 16
  • 8
  • 3
  • +1
2 Solutions
 
CEHJCommented:
Open the Java Console and turn the trace value up. Post what you find
0
 
objectsCommented:
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
 
MILIND_JOGAuthor Commented:
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
MILIND_JOGAuthor Commented:
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
 
objectsCommented:
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
 
MILIND_JOGAuthor Commented:
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
 
CEHJCommented:
Did you put those jars in the right directory?
0
 
MILIND_JOGAuthor Commented:
I put the sqljdbc4.jar in root directory

Milind
0
 
CEHJCommented:
Both need to be in the directory that's your web root
0
 
MILIND_JOGAuthor Commented:
Yes. Both jar is in web root.
0
 
MILIND_JOGAuthor Commented:
I have developed the JAVA application using FRAME. It is not Applet.

Milind
0
 
CEHJCommented:
Open up the Java Contol Panel in Windows Control Panel and set the Console to be visible
0
 
MILIND_JOGAuthor Commented:
The ERROR Appairing is
JAR Resource in JNLP file are not signed by same certificate

0
 
CEHJCommented:
>>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
 
CEHJCommented:
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
 
MILIND_JOGAuthor Commented:
I made the changes in Java Console visible
0
 
MILIND_JOGAuthor Commented:
I made the Java Console visible
0
 
CEHJCommented:
Please post trace and see my comment at

http:#34172409
0
 
MILIND_JOGAuthor Commented:
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
 
MILIND_JOGAuthor Commented:
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
 
MILIND_JOGAuthor Commented:
Hi
The problem is solved

Milind
0
 
MILIND_JOGAuthor Commented:
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
 
objectsCommented:
good to see you got it working
as I mentioned in my earlier comment you need to sign all jars (with same certificate)
0
 
CEHJCommented:
>> I really appreciate your efforts in resolving the issue.

So much so that you've decided to award me zero points ;)
0
 
MILIND_JOGAuthor Commented:
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
 
MILIND_JOGAuthor Commented:
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
 
MILIND_JOGAuthor Commented:
Thanks for the solution.

It helped me a lot in resolving the issue.

Regards

Milind
0
 
mrcoffee365Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 16
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now