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 Vinaya Tirikkovalluru <vi...@converge.com> on 2007/10/23 21:55:29 UTC
Connecting to 2 different Databases
Hi,
I am using iBatis with Spring.
I need to connect to 2 databases of different versions.
I have both the data sources declared in applicationContext.xml
ERP is on Oracle 8i and dataware is on 9i
<bean id="ERP"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>
jdbc:oracle:thin:@abc.xyz.com:4545:dev
</value>
</property>
<property name="username">
<value>user</value>
</property>
<property name="password">
<value>password</value>
</property>
</bean>
<bean id="dataware"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>
jdbc:oracle:thin:@ddd.xyz.com:2222:DWD
</value>
</property>
<property name="username">
<value>user</value>
</property>
<property name="password">
<value>password</value>
</property>
</bean>
I am using jdbc_9.0.2.jar.
I am getting the following error while executing the query for a table
in 8i database..
Executing Statement: select PO_NBR, SCHEDULE_DATE,
PROMISE_DATE, ORDER_QTY, SHIPPED_QTY, CANCELLED_QUANTITY,
ONHAND_QTY, HOLD_NAME from XTRADE_OWNER.OPEN_SO_LINES_VW
where ( PROMISE_DATE >= ?
)
[DEBUG,PreparedStatement,http-8080-Processor25] {pstm-100180}
Parameters: [2005-02-06 00:00:00.0]
[DEBUG,PreparedStatement,http-8080-Processor25] {pstm-100180} Types:
[java.sql.Timestamp]
[DEBUG,HttpSessionContextIntegrationFilter,http-8080-Processor25]
SecurityContextHolder set to new context, as request processing
completed
[ERROR,[Faces Servlet],http-8080-Processor25] Servlet.service() for
servlet Faces Servlet threw exception
java.sql.SQLException: ORA-01024: invalid datatype in OCI call
The same type of query works fine in 9i database. I hace a single
sqlConfig.xml
Do I need to have 2 different sqlConfig files each for each database?
How do I specify the drivers?
Thanks
Vinaya
This electronic message is intended only for the use of the individual(s) or entity(ies) named above and may contain information which is privileged and/or confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution, dissemination or use of the contents of this message is prohibited. If you received this message in error, please notify the sender immediately.