Jim Sloey

Greenhorn
+ Follow
since Nov 07, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jim Sloey

Migrating applications would be nice.
HA configurations and associated problems like putting a new version of code on a running server without disrupting the customer.
Scripts for rotating logs, extracting process IDs for monitoring etc.
Best ways to deploy plugin-cfg.xml and extracting static files (gif,pdf,css,js) for deployment to an external IHS web server on a separate machine.
Setting up SSL etc without the GUI (for those of us with systems behind firewalls).
Thanks
Jim
22 years ago
I posted a note on Dec 31 Topic: Converting servlet to a WebSphere JDBC datasource. Is what's been described here applicable to my problem as well?
The code I'm trying to convert was also built for Tomcat but has it's own connection pool.
Any help would be appreciated. I'm still stuck.
Thanks
22 years ago
I have WebSphere 4.0 running in a clustered HA environment with separate web (2 IHS), application (4 clones, 2 nodes) and database (2 each DB2 & Oracle) tiers. Failover works perfectly on all tiers transparent to the users.
I have a servlet installed that was developed using Tomcat and Eclipse. When Oracle fails-over, this servlet gets a stale db connection and can't recover.
I am probably the worst Java programmer in the world, but I've traced this back to the following code that needs to be converted to use the WebSphere JDBC datasource named s1. Any help in converting would be grtly appreciated.
Thanks... Jim
package com.xgs.data.connection;
import oracle.jdbc.pool.*;
import oracle.jdbc.driver.*;
import java.sql.*;
import com.xgs.data.exception.*;
public class DBConnectionPool {
OracleConnectionCacheImpl myConnectionPool;
OracleConnectionPoolDataSource myDataSource;
protected static OracleConnectionCacheImpl myConnectionCache = null ;
protected static String dbURL ;
protected static String dbUserName ;
protected static String dbPassword ;
protected static int minLimit ;
protected static int maxLimit ;
public synchronized static OracleConnection getDataSource() throws SQLException {
if ( myConnectionCache == null ) {
OracleConnectionPoolDataSource myDataSource = new OracleConnectionPoolDataSource();
myDataSource.setURL( dbURL ) ;
myDataSource.setUser( dbUserName ) ;
myDataSource.setPassword( dbPassword ) ;
// Associate it with the Cache
myConnectionCache = new OracleConnectionCacheImpl ( myDataSource );
// Set the Max Limit
myConnectionCache.setMinLimit (minLimit) ;
myConnectionCache.setMaxLimit (maxLimit) ;
// Set the Scheme
myConnectionCache.setCacheScheme (OracleConnectionCacheImpl.DYNAMIC_SCHEME );
}
return (OracleConnection ) myConnectionCache.getConnection();
}
/**
* Returns the dbPassword.
* @return String
*/
public static String getDbPassword() {
return dbPassword;
}
/**
* Returns the dbURL.
* @return String
*/
public static String getDbURL() {
return dbURL;
}
/**
* Returns the dbUserName.
* @return String
*/
public static String getDbUserName() {
return dbUserName;
}
/**
* Sets the dbPassword.
* @param dbPassword The dbPassword to set
*/
public static void setDbPassword(String dbPassword) {
DBConnectionPool.dbPassword = dbPassword;
}
/**
* Sets the dbURL.
* @param dbURL The dbURL to set
*/
public static void setDbURL(String dbURL) {
DBConnectionPool.dbURL = dbURL;
}
/**
* Sets the dbUserName.
* @param dbUserName The dbUserName to set
*/
public static void setDbUserName(String dbUserName) {
DBConnectionPool.dbUserName = dbUserName;
}
/**
* Returns the maxLimit.
* @return int
*/
public static int getMaxLimit() {
return maxLimit;
}
/**
* Returns the minLimit.
* @return int
*/
public static int getMinLimit() {
return minLimit;
}
/**
* Sets the maxLimit.
* @param maxLimit The maxLimit to set
*/
public static void setMaxLimit(int maxLimit) {
DBConnectionPool.maxLimit = maxLimit;
}
/**
* Sets the minLimit.
* @param minLimit The minLimit to set
*/
public static void setMinLimit(int minLimit) {
DBConnectionPool.minLimit = minLimit;
}
}
22 years ago