You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by to...@apache.org on 2004/01/29 17:09:32 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/ant RepositoryVerifierHandler.java

tomdz       2004/01/29 08:09:32

  Modified:    src/java/org/apache/ojb/broker/ant
                        RepositoryVerifierHandler.java
  Log:
  Added explicit registration of the used jdbc driver as proposed by Tino Schoellhorn
  
  Revision  Changes    Path
  1.13      +9 -2      db-ojb/src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java
  
  Index: RepositoryVerifierHandler.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- RepositoryVerifierHandler.java	28 Jan 2004 23:27:32 -0000	1.12
  +++ RepositoryVerifierHandler.java	29 Jan 2004 16:09:32 -0000	1.13
  @@ -57,6 +57,8 @@
   import java.lang.reflect.Constructor;
   import java.lang.reflect.InvocationTargetException;
   import java.net.MalformedURLException;
  +import java.sql.Driver;
  +import java.sql.DriverManager;
   import java.sql.SQLException;
   import java.sql.SQLWarning;
   import java.util.ArrayList;
  @@ -635,7 +637,12 @@
   
   		try
   		{
  -			retval = new DBUtility(url, userName, password, m_callingTask.loadClass(driver));
  +		    Class jdbcDriver = m_callingTask.loadClass(driver);
  +
  +		    // not every jdbc driver registers itself with the driver manager
  +		    // so we do it explicitly
  +		    DriverManager.registerDriver((Driver)jdbcDriver.newInstance());
  +		    retval = new DBUtility(url, userName, password, jdbcDriver);
   		}
   		catch(ClassNotFoundException cnfe)
   		{
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org