Bug 8558 - Problems with Pointbase URLs passed to DataSource attribute
Summary: Problems with Pointbase URLs passed to DataSource attribute
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-26 13:22 UTC by Lance Andersen
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.