jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql DataSourceUtil.java
Date Thu, 18 Apr 2002 15:24:34 GMT
shawn       02/04/18 08:24:34

  Modified:    standard/src/org/apache/taglibs/standard/tag/common/sql
                        DataSourceUtil.java
  Log:
  Ensured 'driver' is treated as an optional element in the JDBC parameter
  String, per problem report from David Geary.
  
  Revision  Changes    Path
  1.3       +13 -6     jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/DataSourceUtil.java
  
  Index: DataSourceUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/DataSourceUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DataSourceUtil.java	17 Apr 2002 21:21:24 -0000	1.2
  +++ DataSourceUtil.java	18 Apr 2002 15:24:33 -0000	1.3
  @@ -165,13 +165,20 @@
           }
           paramString[aryCount] = params.substring(begin);
   
  +	// use the JDBC URL from the parameter string
           ((DataSourceWrapper)dataSource).setJdbcURL(paramString[0]);
  -        try {
  -            ((DataSourceWrapper)dataSource).setDriverClassName(paramString[1]);
  -        } catch (Exception ex) {
  -            throw new JspTagException(
  -                Resources.getMessage("DRIVER_INVALID_CLASS", ex.getMessage()));
  -        }
  +
  +	// try to load a driver if it's present
  +        if (paramString[1] != null) {
  +            try {
  +                ((DataSourceWrapper)dataSource).setDriverClassName(paramString[1]);
  +            } catch (Exception ex) {
  +                throw new JspTagException(
  +                    Resources.getMessage("DRIVER_INVALID_CLASS", ex.getMessage()));
  +            }
  +	}
  +
  +	// set the username and password
           ((DataSourceWrapper)dataSource).setUserName(paramString[2]);
           ((DataSourceWrapper)dataSource).setPassword(paramString[3]);
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message