Performance degradation in j2sdk1.4 than jdk1.3 for jdbc with oracle

Hi All
I am working on performance issues regarding response time . i have upgraded my system from jdk1.3 to j2sdk1.4 . I was expecting the performance gain in terms of response time in j2sdk1.4. but to my surprise it shows varied results with my application. it shows that j2sdk1.4 is taking higher time for executing the application when it has to deal with database. I am using oracle 9i as the backend database server.
if any body has the idea about, why j2sdk1.4 is showing higher responce time while interacting with database as compare to jdk1.3. then do let me know this.
Thanx in advance

I'm not sure about the error you're getting, but you might want to try a few things:
1) Try the thin driver instead of the oci driver. The thin driver is all java, while the oci requires an Oracle client installation (which might be why your getting the memory error). I think the only programming difference is the URL, so if you need to switch later it should be relatively easy.
2) Instead of DriverManager.registerDriver(), try Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
3) I know this sounds bad, but try throwing some print statements in to see how far you're getting.
Here a quick sample. And remember to include the classes111.zip in your classpath.
import java.sql.*;
public class OracleTest {
  public static void main(String args[]) {
    try {
      Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
      Connection c = DriverManager.getConnection(
                  "jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
      System.out.println("Got connection.");     
      c.close();
   } catch (Exception e) {
      System.out.println("Error: " + e);

Similar Messages

  • Performance degradation using Jolt ASP Connectivity for TUXEDO

    We have a customer that uses Jolt ASP Connectivity for TUXEDO and is suffering
    from a severe performance degradation over time.
    Initial response times are fine (1 s.), but they tend to increase to 3 minutes
    after some time (well, eh, a day or so).
    Data:
    - TUXEDO 7.1
    - Jolt 1.2.1
    - Relatively recent rolling patch installed (so no there are probably no JSH performance
    issues and memory leaks as fixed in earlier patches)
    The ULOG shows that during the night the JSH instances notice a timeout on behalf
    of the client connection and do a forced shutdown of the client:
    040911.csu013.cs.kadaster.nl!JSH.234333.1.-2: JOLT_CAT:1185: "INFO: Userid:
    [ZZ_Webpol], Clientid: [AP_WEBSRV3] timed out due to inactivity"
    040911.csu013.cs.kadaster.nl!JSH.234333.1.-2: JOLT_CAT:1198: "WARN: Forced
    shutdown of client; user name 'ZZ_Webpol'; client name 'AP_WEBSRV3'"
    This happens every 10 minutes as per configuration of the JSL (-T flag).
    The customer "solved" the problem for the time being by increasing the connection
    pool size on the IIS web server.
    However, they didn't find a "smoking gun" - no definite cause for the problem.
    So, it is debatable whether their "solution" suffices.
    It is my suspicion the problem might be located in the Jolt ASP classes running
    on the IIS.
    Maybe the connection pool somehow loses connections over time, causing subsequent
    users having to queue before they get served (although an exception should be
    raised if no connections are available).
    However, there's no documentation on the functioning of the connection pool for
    Jolt ASP.
    My questions:
    1) What's the algorithm used for managing connections with Jolt ASP for TUXEDO?
    2) If connections are terminated by a JSH, will a new connection be established
    from the web server automatically? (this is especially interesting, because the
    connection policy can be configured in the JSL CLOPT, but there's no info on how
    this should be handled/configured by Jolt ASP connectivity for TUXEDO)
    Regards,
    Winfried Scheulderman

    Hi,
    For ASP connectivity I would suggest looking at the .Net client facility provided in Tuxedo 9.1 and later.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • JDBC for JDK1.1 connection with Oracle 8.0.5

    I have a client running Oracle 8.0.5 on an NT machine. I have downloaded the 8.0.5 OCI8 and thin JDBC from Oracle web site.
    Using the JdbcChecker.java sample code, I am unable to make a connection to the Oracle DB. I tested JDK1.1.8 with the new jdbc and also with the jdbc that originally came with Oracle (orant\jdbc\lib) but to no avail. I tested JDK1.2.2 with the 8.1.5 jdbc, also no luck. I compiled and ran the code each time, using
    DriverManager.getConnection("jdbc:oracle:thin:@" + database, username, password);
    where database is a.b.c.d:port_no:sid
    The error that came out for jdk1.1.8 was:
    (after printing out 'connecting...')
    java.sql.SQLException: Refused: ROR=(CODE=12505) (EMFI=4)))) ....
    Is there a daemon or something that is not running? I am new to Oracle but not to jdbc. My client has used Oracle a lot but not doing any java programming with it.
    What am I missing here?
    Thanks.

    Could you verify that the listener for the database is configured properly and that it is running?

  • JDBC with oracle 8.1.6

    Hi ,
    iam using oracle 8.1.6 . I want to pass an xml file as a clob to database
    through Java pl/sql procedure.Iam using setAscii stream function to pass the clob as param from java. When the size of the xml is more than 32 kb.
    iam getting an exception
    SQL exception: java.sql.SQLException: Data size bigger than max size for this type: 32922
    Using clobs we should be able to support 4gb of data?Does Oracle 8.1 support this? Is there any restriction on Clobs in oracle 8.1?
    Can you please help me how I should tackle this problem.
    Thanks
    Chaitanya

    My java application is inside the database oracle 8.1. Is it feasible to use oracle 10 driver?is the driver compatible?
    is theere any restriction as passing parameters to Pl/SQL procedure specifically with oracle 8.1?
    please confirm.

  • Windows Server 2008 and SQL Server 2008 R2 - ?? for replication with Oracle

    Hello:
    I am running Windows Server 2008 and SQL Server 2008 R2 - 64 bit
    I need to replicate data between the SQL 2008 and Oracle 11.2 ?? with Oracle being the publisher
    I also would lile SqlPlus installed on the server.
    I need a definite answer as to what I should download from the Oracle download area. There are just so many packages and so many version I dont know what to download.
    Thanks

    Hi,
    Currently Microsoft Windows Server 2008 and SQL Server 2008 are not supported for SAP Business One.
    For detailed information about all supported platforms, we have the following link for your reference:
    www.service.sap.com/smb/sbo >product availability > supported platforms.
    Regarding the information on the service marketplace this is updated on a regular basis and provides the most up to date information regarding the supported platforms for Business One.
    Platforms not mentioned in this documentation are not supported.
    hope it helps,
    Regards,
    Ladislav
    SAP Business One Forum Team

  • ISetup for use with Oracle Incentive Compensation (OIC)

    I have read conflicting reports as to whether or not iSetup would be available for use to migrate Compensation Plans (and all other OIC configurations) across instances of Oracle Apps eBusiness.
    Does anyone know if R12 (12.04) is capable of handling OIC migrations? Is there any documentation available as to how one would configure iSetup for use with OIC?
    Thanks in advance.

    Hi,
    This is Mugunthan from iSetup development. OIC is not covered as a part of standard selection sets shipped by Oracle. You may consider logging a SR (product code - 841) to get the coverage.
    If you already have java program/scripts that migrate OIC, then you can plugin them with iSetup. You can also write your own BC4J APIs for migration of OIC setups and register with iSetup.
    To know more about writing BC4J iSetup Fwk APIs, please log a SR.

  • Are there any tutorials for JDeveloper with Oracle XE?

    I have downloaded a tutorial for JDeveloper over Oracle.
    In this it uses a connection to the OE (Oracles order entry database?), however it does not contain this database in the XE version.
    There is however a HR (Human resources) database which I made some connection to, but this mean you cannot realy follow the whole tutorial, which is the point of a tutorial.
    Also I read that the License to XE expires the end of next Jan, so that dosent give me much time to check it out.
    thanks.

    You have two options:
    One get the OE creation script from some other Oracle install and install them on the XE database.
    More info on where to get it is here:
    http://www.oracle.com/technology/obe/obe_as_1012/j2ee/common/obeconnection.htm
    Or just use HR tables instead - most of the tutorials simply use a master details relationship - so in OE it is usually the customer who has order - and you can adopt it to the HR schema using the departments that has employees.
    Don't know about the XE license, you might want to ask this on the XE forum.
    Shay

  • I am proposing to upgrade the 4GB RAM in my Mac Mini 2.5 GHz core i5, by replacing it with 2 x 8GB Crucial 'slots'. Will the performance be significantly better than if I upgrade with 2 x 4GB slots? Is it cost effective, is the question.

    My Mac Mini (2.5GHz Core i5) came with 4GB RAM, and I now wish to upgrade the RAM to either 8GB or 16GB in total (Crucial). Clearly, there is a price difference separating the two, but would this be justified by the extent of the improvement in performance, if I went for the more expensive option of 16GB RAM?
    Secondly, if I am allowed to pose two questions: what seems to be the most compliant, reliable and cost effective external hard drive for this or Mac Mini's more generally? I was thinking of purchasing a 3TB HD for storing my rather large collection of photographs and Logic Pro 9 musical endeavours.
    Your experience and advice would be appreciated, my having only recently made the switch from a Windows system to Mac.

    I 150% agree with dwb and woodmeister50 about WD hard drives. They are NOWHERE near the quality they should be. When you can get a Seagate for just a few dollars more, and they last years longer, NO ONE should buy a WD. I lost $25,000 worth of music and audiobooks on a six-week-old WD in 2007 and that was the last I'd ever buy from them. They REFUSED to warranty it with the ORIGINAL sales receipt from Bestbuy.
    I have 16Gb of Crucial RAM in my Mini and here's what I've discovered.
    You WON'T see "lightning fast" performance increases, becasue the Mini is pretty darned fast to begin with. What you WILL see is that when you're running RAM intensive apps like Photoshop or Parallels, other apps won't "bog down".
    Quite frequently I find myself with less than half a gig of free RAM out of that 16. When it was only 8 I was at 100% nearly ALL THE TIME. When I only had the 4 it came with, it was always maxed out.

  • Using jdbc with oracle-for-win95

    i am using oracle thin driver to connect my java code with oracleforwin95 i think it is called as personal oracle, while getting conection DriverManager.getConection("drivername@host:port(1521):sid","user","password") there is no sid for oracleforwin95 if i keep it blank i get an error connection refused some thing like that even i cannot use dsn for connection what is the problem should i use another driver if yes which one it is and from where it can be downloaded, or should i need to configure my oracle. please help me.

    This is my code given below
    import java.sql.*;
    public class Oconnection
         Connection conn;
         Statement st;
         PreparedStatement pst,pstissue,pstret,pstbook;
         public Oconnection()
              try
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","manager");
              catch(Exception ex)
                   System.out.println(ex.getMessage());
                   ex.printStackTrace();
         public static void main(String args[])
              new Oconnection();
    *****************************************************8
    Error
    C:\Library>java Oconnection
    Io exception: The Network Adapter could not establish the connection
    java.sql.SQLException: Io exception: The Network Adapter could not establish the
    connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:177)
    at Oconnection.<init>(Oconnection.java:17)
    at Oconnection.main(Oconnection.java:39)
    I am using Oracle for win95 or i think it is oarcleforwin98 .
    The sid of my database i found through query given by you was orcl, what changes soulh i do int he code so that it works.

  • Best Practices for JDBC with RAC Oracle Thin Driver non-XA Weblogic

    Does anyone have experience on setting up your application server's JDBC connection pools for RAC?
    We are using Weblogic 10 which supports load-balancing between connection pools at the application level, but I believe the listener is load-balanced on the Oracle CRS side as well.
    Is this recommended / not-recommended?

    We use JDBC connection pool. However the load balance
    configured at the database. JDBC uses load_balance=on
    in the connection string. It works fine. I haven't
    tried integrating FAN option and app server.
    You may refer this doc on load balance.
    http://www.oracle.com/technology/products/database/clu
    stering/pdf/twpracwkldmgmt.pdf
    AshokWhat type of application server are you using?

  • Help needed for JDBC with RMI plz reply

    Dear fellows
    i have a problem which is making me circle in hell :( i mean i m trying to get strings from a database class which connects and returns the data as a string to the RMI server mthod, and then the client can call on this to get that String passed on to it for processing.
    when wever i run it it gives me error
    Exception : com.mysql.jdbc.Driver
    when i run that database class alone it runs fine, but when i call it from RMI server method it gives exception?
    can anybody help?
    code is
    Database.java
    import java.sql.*;
    import java.io.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Driver;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.net.InetAddress;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class DatabaseConn {
    String s;
    String roomno;
    DatabaseConn(String roomno){
    //super();
    this.roomno= roomno;
    connect(roomno);
    public String connect(String roomno) {
    Connection con = null;
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection("jdbc:mysql:///pais",
    "koitohay", "ayesha79");
    }catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    try{
    String qs = "SELECT * FROM room where roomid='"+roomno+"'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( qs );
    while (rs.next()) {
    String s1 = rs.getString("roomId");
    int i = rs.getInt("floorId");
    s = rs.getString("Location");
    System.out.println("Location:"+s);
    if(!con.isClosed())
    System.out.println("Successfully connected to " +
    "MySQL server using TCP/IP...");
    }catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    } finally {
    try {
    if(con != null)
    con.close();
    } catch(SQLException e) {}
    return s;
    /*public static void main(String args[]) {
    DatabaseConn rmm= new DatabaseConn("3.15");
    RMI Server
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.LocateRegistry;
    import java.util.*;
    import java.util.Vector;
    import java.sql.*;
    import java.io.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Driver;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.net.InetAddress;
    //import compute.*;
    public class PAISServer extends UnicastRemoteObject
    implements PAIS
    LOCPAIS Loc;
    PositionVal pos;
    String str, CLIENT_IP;
    private static String X,Y,Floor,Room;
    String room;
    JdbcExample2 coon;
    DatabaseConn con;
    public PAISServer() throws RemoteException {
    super();
    public String getPosition(String CLIENT_IP){
    //this.CLIENT_IP = CLIENT_IP;
    LOCPAIS Loc = new LOCPAIS(CLIENT_IP);
    System.out.println("****"+Loc);
    String str = Loc.getLocation();
    //int str2= Loc.getX();
    System.out.println("hi"+str);
    return str; //the original code is here
    //PositionObject pos = new PositionObject("fdf","gdf","rdgdf","fdf") ;
    // process string
    /* pos.X = "10";
    pos.Y = "20";*/
    //return posString;
    //PositionObject str =Loc.getLocation();
    //System.out.println("****"+str);
    //PositionObject posi= (PositionObject)(Loc.getLocation());
    //System.out.println("****"+posi);
    // return str;
    /* Loc.gosietX();
    Loc.getY();
    Loc.getFloor()
    //Tokenize(Loc);
    //return Loc;
    public String getData( String roomno ) {
    try{
    DatabaseConn con= new DatabaseConn(roomno);
    String room= con.connect(Room);
    System.out.println("Data:"+room);
    }catch(Exception e) {
    System.err.println("Exception for: " + e.getMessage());
    return room;

    Hi
    If you start rmiregistry on the side don't include the JDBC driver to the classpath, use CODEBASE when you start the server.
    But again, please give more info.... how you start, how you compile... more traces... etc

  • JDBC setup for j2ee with Oracle

    try{
    Context ic = new InitialContext();
    DataSource ds = (DataSource).lookup "jdbc/Oracle");
    System.out.println(ds.toString());
    //Here it prints out
    //com.sun.enterprise.resource.JdbcDataSource@6bba64
    Connection conn = ds.getConnection("movies","movies");
    // On Conn, I am getting an exception
    conn.close();
    }catch(Exception ex){
    System.out.println(ex);
    Exception I am getting is
    com.sun.enterprise.InvocationException
    My userCongig.bat file has
    set J2EE_CLASSPATH=C:\drivers\classes12.zip;
    My resource.properties file has
    jdbcDataSource.5.name=jdbc/Oracle
    jdbcDataSource.5.url=jdbc\ racle\:thin\:@localhost\:1526\ B816
    jdbcDriver.2.name=oracle.jdbc.driver.OracleDriver

    Hi,
    The DataSource should lookup "jdbc/OracleDS" and not
    "jdbc/Orcale".
    Just try this out...

  • Jdbc with oracle ....run time error!

    I'm trying to connect to Oracle using jdbc.
    this is the simple code for my program, I'm getting run time error...."memory could not be read"
    import java.sql.*;
    class MyCon{
    public static final String JDBC_URL = new String("jdbc:oracle:oci8:@BhDb1onlocalhost");
    public static final String USERNAME = new String("scott");
    public static final String PASSWORD = new String("tiger");
    public static void main(String args[])
    try {
         MyCon myob = new MyCon();
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         Connection con = DriverManager.getConnection(JDBC_URL, USERNAME, PASSWORD);
         Statement stm = con.createStatement();
         ResultSet rs = stm.executeQuery("Select * from Providers");
         ResultSetMetaData rsmd = rs.getMetaData();
         while(rs.next()) {
         for(int count=1;count<=rsmd.getColumnCount();count++) {
              System.out.println(rs.getString(count));
    } catch(Exception e) {
         System.out.println("caught:"+e);
    I'm using windowsNT 4.0
    jdk1.2.2
    oracle 8.1.5
    classess111.zip is in my classpath
    thanx in advance.

    <<jdbc:oracle:oci8:@BhDb1onlocalhost>>
    I haven't ever used the oci8 driver, but you could use the thin driver as follows:
    jdbc:oracle:thin:@localhost:1521:BhDb1
    The thin driver is more portable since it doesn't require the NetClient to be installed.
    Hope this helps.

  • Non-blocking JDBC with Oracle OCI

    I have been monitoring performance for a batch type application in a production environment over the last couple of weeks and all indications are that the blocking JDBC actions are the cause of performance issues in the application. The data access layer is built on Hibernate. And while HIbernate is a fine ORM, and does a great job of creating lightweight, fast individual pieces of SQL, I fear it is the sum of these parts that is causing our problems. I consistently see the Hibernate BatcherImpl getResultSet as consuming the most exclusive time in processing. Of course this is related to the structure of the target database as a lot of this time is being spent in execution.
    What appears to be happening is that the executing threads are blocking until they get a response from the database. We are currently using Thin connections, on 10.2.x drivers. On last reading our processor queue length was as high as 70!! This is a clear indication of a CPU bottleneck.
    I was wondering if it is possible to configure non-blocking JDBC using the OCI type connections instead of Thin connections....
    Any advice someone could give on this topic would be much appreciated.
    Thanks much in advance,
    Jay

    Hi Thomas,
    Thank you for the reply. I am aware that only one statement can be executed on a connection at any given time, and we have connection pooling configured, so that's not a problem.
    More specifically what I am looking for here is that when a thread executes a sql statement using a connection, it seems to block on the processor, it does not switch out, thus not allowing other work to be done while the database satisfies the sql statement. I was wondering if OCI connections were used would the thread switch out until a response was recieved from the database.

  • How do I set miminum # of connections for pool with Oracle and Tomcat?

    Hi,
    I can't seem to find any attribute to initialize the number of connections for my connection pool. Here is my current context.xml file under my /App1 directory:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1" />
    </Context>
    I've been googling and reading forums, but haven't found a way to establish the minimum number of connections. I've tried all sorts of parameters like InitialLimit, MinLimit, MinActive, etc, with no success.
    Here is some sample code that I am testing:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xxx");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT username, server from v$session where username is not null");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; Server: " + rst.getString(2);
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    I'm using a utility to repeatedly call a JSP page that uses this class and displays the message variable. This utility allows me to specify the number of concurrent web requests and an overall number of requests to try. While that is running, I look at V$SESSION in Oracle and occassionaly, I will see a brief entry for app1 or adavey depending on the timing of my query and how far along the code has processed in this example. So it seems that I am only using one connection at a time and not a true connection pool.
    Is it possible that I need to use the oci driver instead of the thin driver? I've looked at the javadoc for oci and the OCIConnectionPool has a setPoolConfig method to set initial, min and max connections. However, it appears that this can only be set via Java code and not as a parameter in my context.xml resource file. If I have to set it each time I get a database connection, it seems like it sort of defeats the purpose of having Tomcat maintain the connection pool for me and that I need to implement my own connection pool. I'm a newbie to this technology so I really don't want to go this route.
    Any advice on setting up a proper connection pool that works with Tomcat and Oracle proxy sessions would be greatly appreciated.
    Thanks,
    Alan

    Well I did some more experiments and I am able to at least create a connection pool within my example code:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    boolean cache_enabled = ds.getConnectionCachingEnabled();
    if (!cache_enabled){
    ds.setConnectionCachingEnabled(true);
    Properties cacheProps = new Properties();
    cacheProps.put("InitialLimit","5");
         cacheProps.put("MinLimit","5");
    cacheProps.put("MaxLimit","10");
    ds.setConnectionCacheProperties(cacheProps);
              conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xyz");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    //rst = stmt.executeQuery("SELECT 'Success obtaining connection' FROM DUAL");
    rst = stmt.executeQuery("SELECT user, SYS_CONTEXT ('USERENV', 'SESSION_USER') from dual");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; sys_context: " + rst.getString(2);
    message += "; Was cache enabled?: " + cache_enabled;
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(OracleConnection.PROXY_SESSION); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    In my context.xml file, I tried to specify the same Connection Cache Properties as attributes, but no luck:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1"
    ConnectionCachingEnabled="1" MinLimit="5" MaxLimit="20"/>
    </Context>
    These attributes seemed to have no effect:
    ConnectionCachingEnabled="1" ; also tried "true"
    MinLimit="5"
    MaxLimit="20"
    So basically if I could find some way to get these attributes set within the context.xml file instead of my code, I would be a happy developer :-)
    Oh well, it's almost Miller time here on the east coast. Maybe a few beers will help me find the solution I'm looking for.

Maybe you are looking for

  • Executing telnet command

    I am trying to execute telnet command from java pgm. If i run the pgm i am not getting the desired output or any exception.Could any one help as the earliest.Following is my code #Pgm public class success1 extends JFrame public static void main(Strin

  • Terminal, Preview and App Store won't start? Please help

    Yesterday after installing "Clean up my Mac" software, I have noticed that Preview doesn't work anymore. At the same time "Command Line Developer Tools for OS X Mavericks" was installed. Today I also noticed that Terminal and App Store won't work. Ho

  • Data Format Problem Pls Help Me

    Hai, I try to insert the date values in the following format the error is occurred, insert statement: insert into temp values (to_date(?,'YYYY/MM/DD')) prepstat_insert.setString(1, end_date); Already the date values are stored in the following format

  • Need Help On Assigment

    I have an assigment to do which is in Pscedo code and it has to be converted into java usin ann.easyio.Keyboard class for input and ann.easyio.Screen for output. for i from 0 to 2 do      output "Enter the name of the employee"      set empName to in

  • Opening the calculator from a site

    CAn anyone tell me how can I make the c:/calculator to pop-up when pressing a buttom from a web site. The way that I have it right now is a exe. file.