This one time, at band camp, Gast, Thorsten  IZ/HZA-IC4 said:

GTI>I am trying to set up my first programm, but I always run in a
GTI>no-suitable-driver-exception.
GTI>I can guarantee that the micrsoft-jdbc-sql-driver is present.
GTI>
GTI>I have the following database.xml:
GTI>  <database name="testdb" engine="sql-server">
GTI>    <driver driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
GTI>            url="jdbc:microsoft:sqlserver://159.51.178.17:1433">
GTI>      <param name="user" value="username"/>
GTI>      <param name="password" value="password"/>
GTI>    </driver>
GTI>    <mapping href="mapping.xml"/>
GTI>  </database>
GTI>
GTI>The code in my program looks the following way:
GTI>    JDO jdo = new JDO("testdb");
GTI>    jdo.setConfiguration("database.xml");
GTI>    jdo.setClassLoader(getClass().getClassLoader());
GTI>    Database db;
GTI>    try {
GTI>      db= jdo.getDatabase();
GTI>    } catch (DatabaseNotFoundException dnfe)   {
GTI>    } catch (PersistenceException pe)  { }
GTI>
GTI>The stacktrace:
GTI>java.sql.SQLException: No suitable driver
GTI>        at java.sql.DriverManager.getDriver(DriverManager.java:243)

Thorsten, 

Well it definitely appears to be a CLASSPATH issue. I see that you're
using the setClassLoader() method from the JDO object. I'm guessing
that your problem lies here. It probably has something to do with the
CLASSPATH that you're setting in your environment not being seeing by
whatever ClassLoader Castor is told to use. If possible, try commenting
out the use of setClassLoader() and see what kind of results you achieve.

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to