db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer ConnectionFactoryAbstractImpl.java
Date Wed, 13 Aug 2003 18:53:35 GMT
arminw      2003/08/13 11:53:35

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ConnectionFactoryAbstractImpl.java
  Log:
  minor improvements
  
  Revision  Changes    Path
  1.7       +7 -10     db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java
  
  Index: ConnectionFactoryAbstractImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ConnectionFactoryAbstractImpl.java	29 May 2003 14:39:34 -0000	1.6
  +++ ConnectionFactoryAbstractImpl.java	13 Aug 2003 18:53:35 -0000	1.7
  @@ -57,7 +57,7 @@
       public void releaseConnection(JdbcConnectionDescriptor jcd, Connection con)
       {
           if (con == null) return;
  -        if (jcd.getDatasourceName() != null)
  +        if (jcd.isDataSource())
           {
               try
               {
  @@ -89,7 +89,7 @@
           use JNDI datasourcelookup or ordinary jdbc DriverManager
           to obtain connection ?
           */
  -        if (jcd.getDatasourceName() != null)
  +        if (jcd.isDataSource())
           {
               if (log.isDebugEnabled())
                   log.debug("do datasource lookup, name: " + jcd.getDatasourceName() +
  @@ -155,11 +155,9 @@
   
       /**
        *
  -     * @param datasourceName The JNDI name where the datasource is bound
  -     * @param user
  -     * @param password
  +     * @param jcd
        * @return an instance of Connection from the named Datasource
  -     * @throws PersistenceBrokerException if we can't get a connection from the datasource
either due to a
  +     * @throws LookupException if we can't get a connection from the datasource either
due to a
        *          naming exception, a failed sanity check, or a SQLException.
        */
       protected Connection newConnectionFromDataSource(JdbcConnectionDescriptor jcd)
  @@ -218,8 +216,6 @@
        * Returns a new created connection
        *
        * @param jcd the connection descriptor
  -     * @param user
  -     * @param pass
        * @return an instance of Connection from the drivermanager
        */
       protected Connection newConnectionFromDriverManager(JdbcConnectionDescriptor jcd)
  @@ -265,6 +261,7 @@
   
       protected String getDbURL(JdbcConnectionDescriptor jcd)
       {
  -        return jcd.getProtocol() + ":" + jcd.getSubProtocol() + ":" + jcd.getDbAlias();
  +        return jcd.isDataSource() ? jcd.getDatasourceName() :
  +                jcd.getProtocol() + ":" + jcd.getSubProtocol() + ":" + jcd.getDbAlias();
       }
   }
  
  
  

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


Mime
View raw message