You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by smelly <sm...@hotmail.com> on 2007/11/21 18:34:17 UTC

about a space at the end

I am using ibatis and oracle 10. The jdbc driver is
oracle.jdbc.driver.OracleDriver. When I retrieve data from table, I found a
space ' ' is appended. Let's say  column ACTIVE_IND CHAR(1), the data
retrieved is 'A '. is it weird? Does anybody have idea?

Thanks a lot,

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC
"-//SPRING//DTD 
BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
	<!--  Data source bean -->
	<bean id="disDataSource"
class="com.xxx.xxx.service.util.ExtendedBasicDataSource"
destroy-method="close">
	  <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
	  <property name="url" value="jdbc:oracle:thin:@169.31.1.62:1521:yyyy"/>
	  <property name="username" value="xxxx"/>
	  <property name="password" value="xxxx"/>
          <property name="connectionProperties">
              <props>
                <prop key="fixedString">true</prop>
              </props>
          </property>
    	</bean>
	<bean id="prodDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
		<!--
		INSERT CONFIG PROPERTIES FOR PRODUCTION DATABASE (Oracle, SQL Server,
MySQL, and etc.)
		-->
	</bean>
	<!--  Web SqlMap setup for iBATIS Database Layer -->
  <bean id="sqlMapClient" 
          class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> 
       <property name="configLocation">
         <value>/WEB-INF/sqlMapConfig.xml</value>
       </property>   
  </bean>
  <bean name="DataBaseAccess" class="com.xxx.xxx.common.IbatisDao"
singleton="false"> 
       <property name="dataSource"><ref bean="xxxDataSource"/></property>
       <property name="sqlMapClient"><ref local="sqlMapClient"/></property>
       <property name="txTemplate"><ref local="txTemplate"/></property> 
  </bean>
  
  <bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  	<property name="dataSource" ref="disDataSource"/>
  </bean>
  
  <bean id="txTemplate"
class="org.springframework.transaction.support.TransactionTemplate">
  	<property name="transactionManager" ref="txManager"/>
  </bean>
  
</beans>


-- 
View this message in context: http://www.nabble.com/about-a-space-at-the-end-tf4851669.html#a13881815
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: about a space at the end

Posted by smelly <sm...@hotmail.com>.
Please notice, the data type of column ACTIVE_IND is Char(1) and the value I
get from retrieving is 'A '. There is a space at the end.


Graeme J Sweeney wrote:
> 
> On Wed, 21 Nov 2007, smelly wrote:
> 
>> I am using ibatis and oracle 10. The jdbc driver is
>> oracle.jdbc.driver.OracleDriver. When I retrieve data from table, I found
>> a
>> space ' ' is appended. Let's say  column ACTIVE_IND CHAR(1), the data
>> retrieved is 'A '. is it weird? Does anybody have idea?
> 
> CHAR is a fixed length, so you get the padding.
> 
> -- 
> Graeme -
> 
> 

-- 
View this message in context: http://www.nabble.com/about-a-space-at-the-end-tf4851669.html#a13884184
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: about a space at the end

Posted by Graeme J Sweeney <ib...@gjsweeney.com>.
On Wed, 21 Nov 2007, smelly wrote:

> I am using ibatis and oracle 10. The jdbc driver is
> oracle.jdbc.driver.OracleDriver. When I retrieve data from table, I found a
> space ' ' is appended. Let's say  column ACTIVE_IND CHAR(1), the data
> retrieved is 'A '. is it weird? Does anybody have idea?

CHAR is a fixed length, so you get the padding.

-- 
Graeme -