I've been having problems connecting to a mysql server via Web Start. I have searched the net for several days now, with no success in finding a solution, so here I am.
My application works fine, until I try and run it via Web Start.
Currently I use -
driver - String driver = "com.mysql.jdbc.Driver";Code:try { Class.forName(driver); } catch (java.lang.ClassNotFoundException e) { Log.fatal(e.toString()); return false; } try { con = DriverManager.getConnection(host, user, pass); } catch (SQLException e) { Log.fatal(e.toString()); return false; } return true; }
host - String "jdbc:mysql://10.0.0.25:3306";
the jnlp file -
Code:<?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.5+" codebase="http://localhost/" href="test.jnlp"> <information> <title>Test Application</title> <vendor>Dynamik Solutions</vendor> <description>Test Application</description> <offline-allowed/> <shortcut online="false"> <desktop/> <menu submenu="Test Apps"/> </shortcut> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.4.2+" java-vm-args="-esa -Xnoclassgc"/> <jar href="test.jar" main="true"/> <jar href="mysql-connector-java-3.1.8-bin.jar" /> </resources> <application-desc main-class="org.stjohn.comp.Start"/> </jnlp>
error created-
<5/07/2005 13:27:42><FATAL> <java.sql.SQLException: No suitable driver>
<5/07/2005 13:27:42><FATAL> <Database initialization failure>
Have tried things like -
andCode:ClassLoader classLoader = this.getClass().getClassLoader(); classLoader.getResource(driver);
Code:ClassLoader cl = Thread.currentThread().getContextClassLoader(); cl.getResource(driver);
Still with no success.
Anyone with a solution?
Thanks in advance
Justin.
PS. jar file has been signed etc


Reply With Quote


Bookmarks