You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jm...@apache.org on 2001/12/30 18:44:40 UTC

cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/adapter DB.java DBCloudscape.java DBHypersonicSQL.java DBInstantDB.java DBOracle.java DBWeblogic.java

jmcnally    01/12/30 09:44:40

  Modified:    src/java/org/apache/torque/adapter Tag: JDBC2POOL_BRANCH
                        DB.java DBCloudscape.java DBHypersonicSQL.java
                        DBInstantDB.java DBOracle.java DBWeblogic.java
  Log:
  removed init and getConnection methods from adapters as there is no differences
  among all the db's accounted for.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.17.2.1  +7 -74     jakarta-turbine-torque/src/java/org/apache/torque/adapter/DB.java
  
  Index: DB.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DB.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- DB.java	24 Nov 2001 17:44:36 -0000	1.17
  +++ DB.java	30 Dec 2001 17:44:39 -0000	1.17.2.1
  @@ -57,7 +57,6 @@
   import java.util.Date;
   import java.io.Serializable;
   import java.sql.Connection;
  -import java.sql.DriverManager;
   import java.sql.SQLException;
   import java.sql.Timestamp;
   import javax.sql.ConnectionPoolDataSource;
  @@ -90,7 +89,7 @@
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  - * @version $Id: DB.java,v 1.17 2001/11/24 17:44:36 mpoeschl Exp $
  + * @version $Id: DB.java,v 1.17.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public abstract class DB implements Serializable, IDMethod
   {
  @@ -106,18 +105,6 @@
       /** <code>SET ROWCOUNT &lt;offset&gt; SELECT ... SET ROWCOUNT 0</code> */
       public static final int LIMIT_STYLE_SYBASE = 3;
   
  -    /** The database user name. */
  -    protected String DB_USER;
  -
  -    /** The database password. */
  -    protected String DB_PASS;
  -
  -    /** The database name. */
  -    protected String DB_CONNECTION;
  -
  -    /** The JDBC driver. */
  -    private String JDBCDriver = null;
  -
       /**
        * Empty constructor.
        */
  @@ -125,33 +112,7 @@
       {
       }
   
  -    /**
  -     * Returns a JDBC <code>Connection</code> from the
  -     * <code>DriverManager</code>.
  -     *
  -     * @return A JDBC <code>Connection</code> object for this database.
  -     * @exception SQLException
  -     */
  -    public Connection getConnection()
  -        throws SQLException
  -    {
  -        // Workaround for buggy Weblogic 5.1 classloader - ignore the
  -        // exception upon first invocation.
  -        try
  -        {
  -            return DriverManager.getConnection( DB_CONNECTION,
  -                                                DB_USER,
  -                                                DB_PASS );
  -        }
  -        catch( ClassCircularityError e )
  -        {
  -            return DriverManager.getConnection( DB_CONNECTION,
  -                                                DB_USER,
  -                                                DB_PASS );
  -        }
  -    }
  -
  -    /**
  +    /* *
        * Returns a new JDBC <code>PooledConnection</code>.
        * The JDBC driver should support the JDBC 2.0 extenstions. Since the
        * implementation of this class is driver specific, the actual class
  @@ -170,35 +131,6 @@
       }
   
       /**
  -     * Performs basic initialization.  Calls Class.forName() to assure
  -     * that the JDBC driver for this adapter can be loaded.
  -     *
  -     * @param url The URL of the database to connect to.
  -     * @param username The name of the user to use when connecting.
  -     * @param password The user's password.
  -     * @exception Exception The JDBC driver could not be loaded or instantiated.
  -     */
  -    public void init(String url,
  -                     String username,
  -                     String password)
  -        throws Exception
  -    {
  -        DB_USER = username;
  -        DB_PASS = password;
  -        DB_CONNECTION = url;
  -
  -        if (JDBCDriver != null)
  -        {
  -            Class.forName( JDBCDriver ).newInstance();
  -        }
  -        else
  -        {
  -            throw new Exception("The JDBC driver must be set for the DB " +
  -                "object with a URL of " + url);
  -        }
  -    }
  -
  -    /**
        * This method is used to ignore case.
        *
        * @param in The string to transform to upper case.
  @@ -292,26 +224,27 @@
           return ignoreCase(in);
       }
   
  -    /**
  +    /* *
        * Sets the JDBC driver used by this adapter.
        *
        * @param newDriver The fully-qualified class name of the JDBC
        * driver to use.
  -     */
  +     * /
       public void setJDBCDriver(String newDriver)
       {
           JDBCDriver = newDriver;
       }
   
  -    /**
  +    /* *
        * Gets the JDBC driver used by this adapter.
        *
        * @return The JDBC Driver classname to use for this DB.
  -     */
  +     * /
       public String getJDBCDriver()
       {
           return(JDBCDriver);
       }
  +    */
   
       /**
        * This method is used to chek whether writing large objects to
  
  
  
  1.1.2.1   +1 -41     jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBCloudscape.java
  
  Index: DBCloudscape.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBCloudscape.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- DBCloudscape.java	12 Nov 2001 05:26:02 -0000	1.1
  +++ DBCloudscape.java	30 Dec 2001 17:44:39 -0000	1.1.2.1
  @@ -63,14 +63,11 @@
    * This is used to connect to Cloudscape SQL databases.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @version $Id: DBCloudscape.java,v 1.1 2001/11/12 05:26:02 jvanzyl Exp $
  + * @version $Id: DBCloudscape.java,v 1.1.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public class DBCloudscape
       extends DB
   {
  -    private String url;
  -    private String username;
  -    private String password;
       private static final String QUALIFIER = ".";
   
       /**
  @@ -79,43 +76,6 @@
       protected DBCloudscape()
       {
       }
  -
  -    /**
  -     * Returns a JDBC <code>Connection</code> from the
  -     * <code>DriverManager</code>.
  -     *
  -     * @return A JDBC <code>Connection</code> object for this
  -     * database.
  -     * @exception SQLException
  -     */
  -    public Connection getConnection()
  -        throws SQLException
  -    {
  -        return DriverManager.getConnection(url, username, password);
  -    }
  -
  -    /**
  -     * Performs basic initialization.  Calls Class.forName() to assure
  -     * that the JDBC driver for this adapter can be loaded.
  -     *
  -     * @param url The URL of the database to connect to.
  -     * @param username The name of the user to use when connecting.
  -     * @param password The user's password.
  -     * @exception Exception The JDBC driver could not be loaded or
  -     * instantiated.
  -     */
  -    public void init(String url,
  -                     String username,
  -                     String password)
  -        throws Exception
  -    {
  -        this.url = url;
  -        this.username = username;
  -        this.password = password;
  -
  -        Class.forName(getJDBCDriver()).newInstance();
  -    }
  -
       /**
        * This method is used to ignore case.
        *
  
  
  
  1.3.2.1   +1 -41     jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBHypersonicSQL.java
  
  Index: DBHypersonicSQL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBHypersonicSQL.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- DBHypersonicSQL.java	13 Aug 2001 22:24:10 -0000	1.3
  +++ DBHypersonicSQL.java	30 Dec 2001 17:44:39 -0000	1.3.2.1
  @@ -64,56 +64,16 @@
    * <a href="http://hsql.oron.ch/">http://hsql.oron.ch</a>
    *
    * @author <a href="mailto:celkins@scardini.com">Christopher Elkins</a>
  - * @version $Id: DBHypersonicSQL.java,v 1.3 2001/08/13 22:24:10 dlr Exp $
  + * @version $Id: DBHypersonicSQL.java,v 1.3.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public class DBHypersonicSQL
       extends DB
   {
  -    private String url;
  -    private String username;
  -    private String password;
  -
       /**
        * Constructor.
        */
       protected DBHypersonicSQL()
       {
  -    }
  -
  -    /**
  -     * Returns a JDBC <code>Connection</code> from the
  -     * <code>DriverManager</code>.
  -     *
  -     * @return A JDBC <code>Connection</code> object for this
  -     * database.
  -     * @exception SQLException
  -     */
  -    public Connection getConnection()
  -        throws SQLException
  -    {
  -        return DriverManager.getConnection(url, username, password);
  -    }
  -
  -    /**
  -     * Performs basic initialization.  Calls Class.forName() to assure
  -     * that the JDBC driver for this adapter can be loaded.
  -     *
  -     * @param url The URL of the database to connect to.
  -     * @param username The name of the user to use when connecting.
  -     * @param password The user's password.
  -     * @exception Exception The JDBC driver could not be loaded or
  -     * instantiated.
  -     */
  -    public void init(String url,
  -                     String username,
  -                     String password)
  -        throws Exception
  -    {
  -        this.url = url;
  -        this.username = username;
  -        this.password = password;
  -
  -        Class.forName(getJDBCDriver()).newInstance();
       }
   
       /**
  
  
  
  1.3.2.1   +1 -35     jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBInstantDB.java
  
  Index: DBInstantDB.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBInstantDB.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- DBInstantDB.java	13 Aug 2001 22:24:10 -0000	1.3
  +++ DBInstantDB.java	30 Dec 2001 17:44:39 -0000	1.3.2.1
  @@ -67,7 +67,7 @@
    *
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
  - * @version $Id: DBInstantDB.java,v 1.3 2001/08/13 22:24:10 dlr Exp $
  + * @version $Id: DBInstantDB.java,v 1.3.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public class DBInstantDB
       extends DB
  @@ -77,40 +77,6 @@
        */
       protected DBInstantDB()
       {
  -    }
  -
  -    /**
  -     * Returns a JDBC <code>Connection</code> from the
  -     * <code>DriverManager</code>.
  -     *
  -     * @return A JDBC <code>Connection</code> object for this
  -     * database.
  -     * @exception SQLException
  -     */
  -    public Connection getConnection()
  -        throws SQLException
  -    {
  -        return DriverManager.getConnection( DB_CONNECTION );
  -    }
  -
  -    /**
  -     * Performs basic initialization.  Calls Class.forName() to assure
  -     * that the JDBC driver for this adapter can be loaded.
  -     *
  -     * @param url The URL of the database to connect to.
  -     * @param username The name of the user to use when connecting.
  -     * @param password The user's password.
  -     * @exception Exception The JDBC driver could not be loaded or
  -     * instantiated.
  -     */
  -    public void init(String url,
  -                     String username,
  -                     String password)
  -        throws Exception
  -    {
  -        DB_CONNECTION = "jdbc:idb=" + url;
  -
  -        Class.forName( getJDBCDriver() ).newInstance();
       }
   
       /**
  
  
  
  1.8.2.1   +3 -1      jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBOracle.java
  
  Index: DBOracle.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBOracle.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- DBOracle.java	22 Aug 2001 20:12:08 -0000	1.8
  +++ DBOracle.java	30 Dec 2001 17:44:39 -0000	1.8.2.1
  @@ -69,7 +69,7 @@
    *
    * @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
  - * @version $Id: DBOracle.java,v 1.8 2001/08/22 20:12:08 dlr Exp $
  + * @version $Id: DBOracle.java,v 1.8.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public class DBOracle
       extends DB
  @@ -176,6 +176,7 @@
           con.commit();
       }
   
  +    /*
       public ConnectionPoolDataSource getConnectionPoolDataSource()
           throws java.sql.SQLException
       {
  @@ -198,6 +199,7 @@
                   SQLException("Could not create OracleConnectioPoolDataSource object: " + e);
           }
       }
  +    */
   
      /**
       * This method is for the SqlExpression.quoteAndEscape rules.  The rule is,
  
  
  
  1.4.2.1   +1 -37     jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBWeblogic.java
  
  Index: DBWeblogic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBWeblogic.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- DBWeblogic.java	19 Aug 2001 02:56:35 -0000	1.4
  +++ DBWeblogic.java	30 Dec 2001 17:44:39 -0000	1.4.2.1
  @@ -65,53 +65,17 @@
    *
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
  - * @version $Id: DBWeblogic.java,v 1.4 2001/08/19 02:56:35 brekke Exp $
  + * @version $Id: DBWeblogic.java,v 1.4.2.1 2001/12/30 17:44:39 jmcnally Exp $
    */
   public class DBWeblogic
       extends DB
   {
  -    private String DATABASE_POOL;   // = "jdbc:weblogic:pool:mla";
  -
       /**
        * Empty constructor.
        */
       protected DBWeblogic()
       {
       }
  -
  -    /**
  -     * Returns a JDBC <code>Connection</code> from the
  -     * <code>DriverManager</code>.
  -     *
  -     * @return A JDBC <code>Connection</code> object for this
  -     * database.
  -     * @exception SQLException
  -     */
  -    public Connection getConnection()
  -        throws SQLException
  -    {
  -        return DriverManager.getConnection(DATABASE_POOL, null);
  -    }
  -
  -    /**
  -     * Performs basic initialization.  Calls Class.forName() to assure
  -     * that the JDBC driver for this adapter can be loaded.
  -     *
  -     * @param url The URL of the database to connect to.
  -     * @param username The name of the user to use when connecting.
  -     * @param password The user's password.
  -     * @exception Exception The JDBC driver could not be loaded or
  -     * instantiated.
  -     */
  -    public void init(String url,
  -                     String username,
  -                     String password)
  -        throws Exception
  -    {
  -        DATABASE_POOL = url;
  -        Class.forName( getJDBCDriver() ).newInstance();
  -    }
  -
       /**
        * This method is used to ignore case.
        *
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>