Hi everybody, my application(web) connect 2 databases and their versions are different 9i and 10g(10.2.0.3) and java version 1.5 and tomcat 5.5.
Which driver should I use? Is it suitible using ojdbc14.jar?
Sometimes I get error <font face="courier">"java.sql.SQLException: Io exception: Connection reset"</font>, and I couldn't solve it. I think it is about jdbc driver.
Also I get connection like below
private Connection getConnection(String dsName) {
Connection conn = null;
try {
Context initContext = new InitialContext();
Context envContext = (Context) initContext.lookup("java:/comp/env/jdbc");
DataSource ds = (DataSource) envContext.lookup(dsName);
conn = ds.getConnection();
conn.setAutoCommit(true);
} catch (Exception ex) {
ex.printStackTrace();
}
return conn;
}
web.xml
<Context path="/app">
<Resource
auth="Container"
name="jdbc/orcl9"
type="javax.sql.DataSource"
password="orcl9"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="7"
maxWait="10000"
username="orcl9"
url="..."
maxActive="10"/>
<Resource
auth="Container"
name="jdbc/orcl10"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
password="orcl10"
maxIdle="7"
maxWait="10000"
username="orcl10"
url="...."
maxActive="10"/>
</Context>
</Host>
Please help,
Edited by: ilkinesrefli on Mar 14, 2011 11:43 PM