Hi there!

 

Your real problem working with 2 different databases, is that they are of 
different versions and as long the driver class is the same in 8i and 9i, your 
are stuck to one driver :-)

As far as I know how.

 

What you could try, is to use a 8i driver to see if the query runs agains the 
8i database, if it runs, then the fun starts :-) Then you need to find a driver 
that runs both for your 8i and 9i databases and your query :-) 9.0.2 is not the 
one :-)

 

You could try to change from java.sql.Timestamp to java.sql.Datetime if it's 
the timestamp is the problem ?

 

No you shouldn't have two config files, you could, but the problem is the same 
name on the driver class for 8i and 9i.

 

A good sql tool, is DbVisualizer, recommend the Personal one, then you can set 
up different db connetion to the same database with different jdbc driver, that 
can maybe help you to figure this out. 

 

 

Good luck !

Erlend

 

 

________________________________

Fra: Vinaya Tirikkovalluru [mailto:[EMAIL PROTECTED] 
Sendt: 23. oktober 2007 21:55
Til: [email protected]
Emne: 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. 

Reply via email to