You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Sukhyung Lee (JIRA)" <ib...@incubator.apache.org> on 2005/02/24 07:01:48 UTC

[jira] Created: (IBATIS-78) JDBC driver properties does not work when using DBCP

JDBC driver properties does not work when using DBCP
----------------------------------------------------

         Key: IBATIS-78
         URL: http://issues.apache.org/jira/browse/IBATIS-78
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.0.9    
 Environment: Windows, Tomcat 5.0, Oracle 9i
    Reporter: Sukhyung Lee


I am using iBatis Sqlamp with Oracle and have Oracle type compare problem.

Oracle CHAR type compare problem is :
1) User table has user_id = '111' 
2) user_id column type is CHAR(7)
3) When I set user_id = "111" and the select statement could NOT find the row.
4) When I set user_id = "111    " and the select statement could find the row.

The java source code is here. 

String user_id = "111";  // Search fail 
//String user_id = "111    ";  // Search successful
try
{
    User user = new User();
    user.setUser_id(user_id);        

    user = (User) sqlMap.queryForObject("getUser", user);

    if (user == null)
    {
         System.out.print("Can not find User . user_id=" + user_id);
    }
    else
    {
         System.out.println("User Information:");
         System.out.println("user_id=" + user.getUser_id());
         System.out.println("user_name=" + user.getUser_name());
    }
}

I set Driver.fixedString to true to solve Oracle CHAR type compare problem like below. (Actually to solve this problem I need Custom Type Handler also)

<transactionManager type="JDBC">
             <dataSource type="SIMPLE">
                           <property value="${driver}" name="JDBC.Driver"/>
                           <property value="${url}" name="JDBC.ConnectionURL"/>
                           <property value="${username}" name="JDBC.Username"/>
                           <property value="${password}" name="JDBC.Password"/>
                           <property value="128" name="Pool.MaximumActiveConnections"/>
                           <property value="128" name="Pool.MaximumIdleConnections"/>
                           <property value="1000" name="Pool.MaximumWait"/>
                           <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
                           <property value="true" name="Driver.fixedString"/>
             </dataSource>
</transactionManager>

It worked fine and I and trying to use DBCP instead of SimpleDataSource and
modified transactionMangager definition like below.

<transactionManager type="JDBC">
             <dataSource type="DBCP">
                           <property value="${driver}" name="JDBC.Driver"/>
                           <property value="${url}" name="JDBC.ConnectionURL"/>
                           <property value="${username}" name="JDBC.Username"/>
                           <property value="${password}" name="JDBC.Password"/>
                           <property value="15" name="Pool.MaximumActiveConnections"/>
                           <property value="1" name="Pool.MaximumIdleConnections"/>
                           <property value="5000" name="Pool.MaximumWait"/>
                           <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
                           <property value="true" name="Driver.fixedString"/>
                           <!-- DBCP Property -->
                           <property value="select count(*) from dual" name="Pool.ValidationQuery"/>
                           <property value="true" name="Pool.LogAbandoned"/>
                           <property value="false" name="Pool.RemoveAbandoned"/>
                           <property value="50000" name="Pool.RemoveAbandonedTimeout"/>
             </dataSource>
</transactionManager>

With above transactionManager definition, fixedString JDBC connection property does not set to true and CHAR type compare problem occured again.

Could you please help me to solve this problem?

Regards,
Sukhyung Lee
Inzent Co., Ltd


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-78) JDBC driver properties does not work when using DBCP

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-78?page=comments#action_62454 ]
     
Brandon Goodin commented on IBATIS-78:
--------------------------------------

Have you tried appending the connection properties to your url?

SimpleDataSource should work for you it takes anything marked with 'Driver.' and passes them into the DriverManager.getConnection(jdbcUrl, driverProps) when the connection is retrieved.

IBatis uses the BasicDataSource class to configure DBCP. It sets values with addConnectionProperty(String name, String value) and passes the values in at connection time as well. I'll add the support for this.


> JDBC driver properties does not work when using DBCP
> ----------------------------------------------------
>
>          Key: IBATIS-78
>          URL: http://issues.apache.org/jira/browse/IBATIS-78
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9
>  Environment: Windows, Tomcat 5.0, Oracle 9i
>     Reporter: Sukhyung Lee

>
> I am using iBatis Sqlamp with Oracle and have Oracle type compare problem.
> Oracle CHAR type compare problem is :
> 1) User table has user_id = '111' 
> 2) user_id column type is CHAR(7)
> 3) When I set user_id = "111" and the select statement could NOT find the row.
> 4) When I set user_id = "111    " and the select statement could find the row.
> The java source code is here. 
> String user_id = "111";  // Search fail 
> //String user_id = "111    ";  // Search successful
> try
> {
>     User user = new User();
>     user.setUser_id(user_id);        
>     user = (User) sqlMap.queryForObject("getUser", user);
>     if (user == null)
>     {
>          System.out.print("Can not find User . user_id=" + user_id);
>     }
>     else
>     {
>          System.out.println("User Information:");
>          System.out.println("user_id=" + user.getUser_id());
>          System.out.println("user_name=" + user.getUser_name());
>     }
> }
> I set Driver.fixedString to true to solve Oracle CHAR type compare problem like below. (Actually to solve this problem I need Custom Type Handler also)
> <transactionManager type="JDBC">
>              <dataSource type="SIMPLE">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="128" name="Pool.MaximumActiveConnections"/>
>                            <property value="128" name="Pool.MaximumIdleConnections"/>
>                            <property value="1000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>              </dataSource>
> </transactionManager>
> It worked fine and I and trying to use DBCP instead of SimpleDataSource and
> modified transactionMangager definition like below.
> <transactionManager type="JDBC">
>              <dataSource type="DBCP">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="15" name="Pool.MaximumActiveConnections"/>
>                            <property value="1" name="Pool.MaximumIdleConnections"/>
>                            <property value="5000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>                            <!-- DBCP Property -->
>                            <property value="select count(*) from dual" name="Pool.ValidationQuery"/>
>                            <property value="true" name="Pool.LogAbandoned"/>
>                            <property value="false" name="Pool.RemoveAbandoned"/>
>                            <property value="50000" name="Pool.RemoveAbandonedTimeout"/>
>              </dataSource>
> </transactionManager>
> With above transactionManager definition, fixedString JDBC connection property does not set to true and CHAR type compare problem occured again.
> Could you please help me to solve this problem?
> Regards,
> Sukhyung Lee
> Inzent Co., Ltd

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATIS-78) JDBC driver properties does not work when using DBCP

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-78?page=all ]
     
Clinton Begin closed IBATIS-78:
-------------------------------


> JDBC driver properties does not work when using DBCP
> ----------------------------------------------------
>
>          Key: IBATIS-78
>          URL: http://issues.apache.org/jira/browse/IBATIS-78
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9
>  Environment: Windows, Tomcat 5.0, Oracle 9i
>     Reporter: Sukhyung Lee
>     Assignee: Brandon Goodin
>      Fix For: 2.1.0

>
> I am using iBatis Sqlamp with Oracle and have Oracle type compare problem.
> Oracle CHAR type compare problem is :
> 1) User table has user_id = '111' 
> 2) user_id column type is CHAR(7)
> 3) When I set user_id = "111" and the select statement could NOT find the row.
> 4) When I set user_id = "111    " and the select statement could find the row.
> The java source code is here. 
> String user_id = "111";  // Search fail 
> //String user_id = "111    ";  // Search successful
> try
> {
>     User user = new User();
>     user.setUser_id(user_id);        
>     user = (User) sqlMap.queryForObject("getUser", user);
>     if (user == null)
>     {
>          System.out.print("Can not find User . user_id=" + user_id);
>     }
>     else
>     {
>          System.out.println("User Information:");
>          System.out.println("user_id=" + user.getUser_id());
>          System.out.println("user_name=" + user.getUser_name());
>     }
> }
> I set Driver.fixedString to true to solve Oracle CHAR type compare problem like below. (Actually to solve this problem I need Custom Type Handler also)
> <transactionManager type="JDBC">
>              <dataSource type="SIMPLE">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="128" name="Pool.MaximumActiveConnections"/>
>                            <property value="128" name="Pool.MaximumIdleConnections"/>
>                            <property value="1000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>              </dataSource>
> </transactionManager>
> It worked fine and I and trying to use DBCP instead of SimpleDataSource and
> modified transactionMangager definition like below.
> <transactionManager type="JDBC">
>              <dataSource type="DBCP">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="15" name="Pool.MaximumActiveConnections"/>
>                            <property value="1" name="Pool.MaximumIdleConnections"/>
>                            <property value="5000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>                            <!-- DBCP Property -->
>                            <property value="select count(*) from dual" name="Pool.ValidationQuery"/>
>                            <property value="true" name="Pool.LogAbandoned"/>
>                            <property value="false" name="Pool.RemoveAbandoned"/>
>                            <property value="50000" name="Pool.RemoveAbandonedTimeout"/>
>              </dataSource>
> </transactionManager>
> With above transactionManager definition, fixedString JDBC connection property does not set to true and CHAR type compare problem occured again.
> Could you please help me to solve this problem?
> Regards,
> Sukhyung Lee
> Inzent Co., Ltd

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (IBATIS-78) JDBC driver properties does not work when using DBCP

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-78?page=history ]

Brandon Goodin reassigned IBATIS-78:
------------------------------------

    Assign To: Brandon Goodin

> JDBC driver properties does not work when using DBCP
> ----------------------------------------------------
>
>          Key: IBATIS-78
>          URL: http://issues.apache.org/jira/browse/IBATIS-78
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9
>  Environment: Windows, Tomcat 5.0, Oracle 9i
>     Reporter: Sukhyung Lee
>     Assignee: Brandon Goodin

>
> I am using iBatis Sqlamp with Oracle and have Oracle type compare problem.
> Oracle CHAR type compare problem is :
> 1) User table has user_id = '111' 
> 2) user_id column type is CHAR(7)
> 3) When I set user_id = "111" and the select statement could NOT find the row.
> 4) When I set user_id = "111    " and the select statement could find the row.
> The java source code is here. 
> String user_id = "111";  // Search fail 
> //String user_id = "111    ";  // Search successful
> try
> {
>     User user = new User();
>     user.setUser_id(user_id);        
>     user = (User) sqlMap.queryForObject("getUser", user);
>     if (user == null)
>     {
>          System.out.print("Can not find User . user_id=" + user_id);
>     }
>     else
>     {
>          System.out.println("User Information:");
>          System.out.println("user_id=" + user.getUser_id());
>          System.out.println("user_name=" + user.getUser_name());
>     }
> }
> I set Driver.fixedString to true to solve Oracle CHAR type compare problem like below. (Actually to solve this problem I need Custom Type Handler also)
> <transactionManager type="JDBC">
>              <dataSource type="SIMPLE">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="128" name="Pool.MaximumActiveConnections"/>
>                            <property value="128" name="Pool.MaximumIdleConnections"/>
>                            <property value="1000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>              </dataSource>
> </transactionManager>
> It worked fine and I and trying to use DBCP instead of SimpleDataSource and
> modified transactionMangager definition like below.
> <transactionManager type="JDBC">
>              <dataSource type="DBCP">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="15" name="Pool.MaximumActiveConnections"/>
>                            <property value="1" name="Pool.MaximumIdleConnections"/>
>                            <property value="5000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>                            <!-- DBCP Property -->
>                            <property value="select count(*) from dual" name="Pool.ValidationQuery"/>
>                            <property value="true" name="Pool.LogAbandoned"/>
>                            <property value="false" name="Pool.RemoveAbandoned"/>
>                            <property value="50000" name="Pool.RemoveAbandonedTimeout"/>
>              </dataSource>
> </transactionManager>
> With above transactionManager definition, fixedString JDBC connection property does not set to true and CHAR type compare problem occured again.
> Could you please help me to solve this problem?
> Regards,
> Sukhyung Lee
> Inzent Co., Ltd

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (IBATIS-78) JDBC driver properties does not work when using DBCP

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-78?page=history ]
     
Brandon Goodin resolved IBATIS-78:
----------------------------------

     Resolution: Fixed
    Fix Version: 2.1.0

added functionality to DBCP that uses the "Driver." notation to assign connection properties.
<property value="[propertyValue]" name="Driver.[propertyName]"/> 

> JDBC driver properties does not work when using DBCP
> ----------------------------------------------------
>
>          Key: IBATIS-78
>          URL: http://issues.apache.org/jira/browse/IBATIS-78
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9
>  Environment: Windows, Tomcat 5.0, Oracle 9i
>     Reporter: Sukhyung Lee
>     Assignee: Brandon Goodin
>      Fix For: 2.1.0

>
> I am using iBatis Sqlamp with Oracle and have Oracle type compare problem.
> Oracle CHAR type compare problem is :
> 1) User table has user_id = '111' 
> 2) user_id column type is CHAR(7)
> 3) When I set user_id = "111" and the select statement could NOT find the row.
> 4) When I set user_id = "111    " and the select statement could find the row.
> The java source code is here. 
> String user_id = "111";  // Search fail 
> //String user_id = "111    ";  // Search successful
> try
> {
>     User user = new User();
>     user.setUser_id(user_id);        
>     user = (User) sqlMap.queryForObject("getUser", user);
>     if (user == null)
>     {
>          System.out.print("Can not find User . user_id=" + user_id);
>     }
>     else
>     {
>          System.out.println("User Information:");
>          System.out.println("user_id=" + user.getUser_id());
>          System.out.println("user_name=" + user.getUser_name());
>     }
> }
> I set Driver.fixedString to true to solve Oracle CHAR type compare problem like below. (Actually to solve this problem I need Custom Type Handler also)
> <transactionManager type="JDBC">
>              <dataSource type="SIMPLE">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="128" name="Pool.MaximumActiveConnections"/>
>                            <property value="128" name="Pool.MaximumIdleConnections"/>
>                            <property value="1000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>              </dataSource>
> </transactionManager>
> It worked fine and I and trying to use DBCP instead of SimpleDataSource and
> modified transactionMangager definition like below.
> <transactionManager type="JDBC">
>              <dataSource type="DBCP">
>                            <property value="${driver}" name="JDBC.Driver"/>
>                            <property value="${url}" name="JDBC.ConnectionURL"/>
>                            <property value="${username}" name="JDBC.Username"/>
>                            <property value="${password}" name="JDBC.Password"/>
>                            <property value="15" name="Pool.MaximumActiveConnections"/>
>                            <property value="1" name="Pool.MaximumIdleConnections"/>
>                            <property value="5000" name="Pool.MaximumWait"/>
>                            <!-- To resolve Oracle CHAR Type compare problem, need fixedString=true-->
>                            <property value="true" name="Driver.fixedString"/>
>                            <!-- DBCP Property -->
>                            <property value="select count(*) from dual" name="Pool.ValidationQuery"/>
>                            <property value="true" name="Pool.LogAbandoned"/>
>                            <property value="false" name="Pool.RemoveAbandoned"/>
>                            <property value="50000" name="Pool.RemoveAbandonedTimeout"/>
>              </dataSource>
> </transactionManager>
> With above transactionManager definition, fixedString JDBC connection property does not set to true and CHAR type compare problem occured again.
> Could you please help me to solve this problem?
> Regards,
> Sukhyung Lee
> Inzent Co., Ltd

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira