Bug 8558

Summary: Problems with Pointbase URLs passed to DataSource attribute
Product: Taglibs Reporter: Lance Andersen <Lance.Andersen>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: normal CC: Ryan.Lubke
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Lance Andersen 2002-04-26 13:22:46 UTC
Pointbase JDBC driver allows f or parameters to be passed comma separated:

jdbc:pointbase:server://localhost/sample,pointbase.ini=/files1/pointbase/samples/server_embedded/pointbase.ini


When you try and specify the DriverManager Parameters to the dataSource
attribute you will get java.lang.ArrayIndexOutOfBoundsException. The key portion
of the stacktrace is:


java.lang.ArrayIndexOutOfBoundsException
        at
org.apache.taglibs.standard.tag.common.sql.DataSourceUtil.getDataSource(DataSourceUtil.java:155)
        at
org.apache.taglibs.standard.tag.common.sql.DataSourceUtil.getDataSource(DataSourceUtil.java:111)
        at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:303)
        at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:192)
        at
org.apache.taglibs.standard.tag.el.sql.QueryTag.doStartTag(QueryTag.java:125)
        at
org.apache.jsp.positiveQueryDataSourceAttributeDriverManagerTest$jsp._jspService(positiveQueryDataSourceAttributeDriverManagerTest$jsp.java:123)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

Sample code to repro:

   <c:set var='driverInfo'
         
value="${initParam.URL},${initParam.driver},${initParam.user},${initParam.password}"
/>

 


      <sql:query dataSource="${driverInfo}" var='resultSet'>
         <c:out value="${sqlProps.Simple_Select_Query}" />
      </sql:query>

The workaround is to use a ';' for the separator instead of a comma but we
should revisit the format for the driverManager String
Comment 1 Lance Andersen 2002-04-26 15:18:34 UTC
I realize that I can probably escape the ',' in the URL per section 10.1.1 of
the jstl spec, but I think this
is going to be errorprone (as I missed this the 1st time going through the
doc)...
Comment 2 Shawn Bayern 2002-04-26 15:27:40 UTC
Not an implementation bug.