Lightweight command to test JDBC connections on a pool

Hi,
today to test a pool of JDBC connections i use this command:
SELECT NOW() FROM DBA.DUAL
i'm using a lightweight command? or exists some other that can cost less to database?
thanks for any tip
Clóvis

>
SELECT NOW() FROM DBA.DUAL
Hi Clovis,
the command is pretty lightweight.
No IO is needed for that.
If you want to save even more CPU cycles, you may try switching to
SELECT user FROM DBA.DUAL
This should be a little tick quicker as it does not need to make a system call to get the current time.
Anyhow, the difference should be negligible.
regards,
Lars

Similar Messages

  • Test JDBC connection problem

    Hi all,
    I got a very weird problem when I click Test Connection Button.
    I installed xml publisher Enterprise 5.6.2 in the server, I attempt to configure Jdbc connection in this server. once I click the Test Connection Button after I input all information, all information will be cleaned in this server, i can not get any message if the connection works well.But if i use url like http://serverIP:15101/xmlpserver/ to login xml publisher on other machine, I will get successful or error message.
    who has same experience in JDBC configuration?how to solve it ,thanks in advance.

    Apologies ... not really sure what the issue is. I assume you are talking about setting up the JDBC connection for a data source?
    In that case the entries would be something like:
    connection string: jdbc:oracle:thin:@host.company.com:1525:ora10g
    un: oe
    pw oe
    driver class: oracle.jdbc.driver.OracleDriver

  • Problem w. transaction notSupported / releasing JDBC connections

              We are making a call from our EJB client to a stateless session EJB (1) with transaction attribute 'Required' for all methods. From this EJB (1) we get a JDBC connection from the pool and do some JDBC calls (no updates). We then make a call to a method in another stateles session EJB (2) with transaction attribute 'NotSupported' for all methods. In EJB2 we get a JDBC connection from the pool and do some JDBC calls (no updates). Something goes wrong and we catch a SqlException. We then throw a EJBException. So far everything is OK. But now we get a SqlException from the transaction: 'java.sql.SQLException: Connection is currently associated with xid: 970661671558_182.Rollback attempted in the scope of a different transaction'. It seems like the container tries to perform a rollback on the EJB tat doesn't support transactions. Shouldn't the transaction have been suspended when we entered the method in EJB2? Our problem is that the JDBC connection we got from the pool doesn't get released even though we closed it in a finally-statement in both EJB:s. So after some time we are out of free JDBC connections in our connection pool. Does anyone know why this happens?
              /Per
              

              We are making a call from our EJB client to a stateless session EJB (1) with transaction attribute 'Required' for all methods. From this EJB (1) we get a JDBC connection from the pool and do some JDBC calls (no updates). We then make a call to a method in another stateles session EJB (2) with transaction attribute 'NotSupported' for all methods. In EJB2 we get a JDBC connection from the pool and do some JDBC calls (no updates). Something goes wrong and we catch a SqlException. We then throw a EJBException. So far everything is OK. But now we get a SqlException from the transaction: 'java.sql.SQLException: Connection is currently associated with xid: 970661671558_182.Rollback attempted in the scope of a different transaction'. It seems like the container tries to perform a rollback on the EJB tat doesn't support transactions. Shouldn't the transaction have been suspended when we entered the method in EJB2? Our problem is that the JDBC connection we got from the pool doesn't get released even though we closed it in a finally-statement in both EJB:s. So after some time we are out of free JDBC connections in our connection pool. Does anyone know why this happens?
              /Per
              

  • Problems testing a Connection to the OCI8 Driver for Oracle 8.1.7  from the Command Line

    Hello,
    I am configuring a JDBC Connection to an Oracle 8.1.7 from WebLogic 7.0.0. I want
    to use an OCI driver.
    When I am testing the driver, I execute the command (From DOS console in Win 2k
    Professional):
    java utils.dbping ORACLE myUser myPassword myDB
    But it produces the next error:
    Error encountered:
    java.sql.SQLException: System.loadLibrary(weblogicoci38) threw java.lang.Unsatis
    fiedLinkError: C:\bea\weblogic700\server\bin\oci817_8\weblogicoci38.dll: No se
    e
    ncontr¾ el proceso especificado
    at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:218)
    at weblogic.jdbc.oci.Driver.connect(Driver.java:94)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:146)
    at utils.dbping.main(dbping.java:175)
    Also, a window appears and displays the next message:
    "It does not find the entry point to procedure OCILobLocatorAssign" in the dll
    OCI.dll"
    My environment variable PATH is defined as follows:
    Path=C:\bea\weblogic700\server\bin;
    C:\bea\jdk131_02\bin;C:\bea\weblogic700\server\bin\oci817_8; C:\orant\bin;C:\local\bin;c:\DMI\WIN32\BIN;H:\AURORA\BIN;C:\WINDOWS;
    C:\WINDOWS\system32;C:\WINDOWS\system32\WBEM
    Can you help me !
    In advance thanks !
    - Ricardo (Bogota-Colombia-South America).

    Do you see a folder lib32 instead. Otherwise you will have to install Oracle
    client on the machine to use OCI.
    sree
    "Ricardo De la Rosa" <[email protected]> wrote in message
    news:[email protected]...
    >
    Sree,
    In this moment I don't have an environment variable ORACLE_HOME, and Ihave two
    candidate directories to be the value of this variable: The firstcandidate directory
    is C:\orant, and C:\orant\bin exists but C:\orant\lib doesn't exist.
    The second candidate is C:\local; and C:\local\bin exists, butC:\local\lib doesn't
    exist, and C:\local\oci80\lib\borland\oci.lib & andC:\local\oci80\lib\borland\ociw32.lib
    and C:\local\oci80\lib\msvc\oci.lib & andC:\local\oci80\lib\msvc\ociw32.lib
    >
    >
    I tested the conection with both candidates but it doesn't work withanyone.
    >
    Sree, do you know what happen ??
    Thank you !!
    - Ricardo (Colombia-South America).
    "Sree Bodapati" <[email protected]> wrote:
    Hi Ricardo,
    You need to have a environment variable ORACLE_HOME set and then make
    sure
    you have "%WL_HOME%\bin\oci817_8; %ORACLE_HOME%\bin;ORACLE_HOME%\lib"
    in the
    path .
    (replace WL_HOME with what ever your path to the WLS bin folder is)
    hth
    sree
    "Ricardo De la Rosa" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    I am configuring a JDBC Connection to an Oracle 8.1.7 from WebLogic7.0.0.
    I want
    to use an OCI driver.
    When I am testing the driver, I execute the command (From DOS consolein
    Win 2k
    Professional):
    java utils.dbping ORACLE myUser myPassword myDB
    But it produces the next error:
    Error encountered:
    java.sql.SQLException: System.loadLibrary(weblogicoci38) threwjava.lang.Unsatis
    fiedLinkError:
    C:\bea\weblogic700\server\bin\oci817_8\weblogicoci38.dll:
    No se
    e
    ncontr¾ el proceso especificado
    at
    weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:218)
    at weblogic.jdbc.oci.Driver.connect(Driver.java:94)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:146)
    at utils.dbping.main(dbping.java:175)
    Also, a window appears and displays the next message:
    "It does not find the entry point to procedure OCILobLocatorAssign"in the
    dll
    OCI.dll"
    My environment variable PATH is defined as follows:
    Path=C:\bea\weblogic700\server\bin;
    C:\bea\jdk131_02\bin;C:\bea\weblogic700\server\bin\oci817_8;C:\orant\bin;C:\local\bin;c:\DMI\WIN32\BIN;H:\AURORA\BIN;C:\WINDOWS;
    C:\WINDOWS\system32;C:\WINDOWS\system32\WBEM
    Can you help me !
    In advance thanks !
    - Ricardo (Bogota-Colombia-South America).

  • JDBC  Connection Test Fails

    After a successful install, I am missing files and directories per this document:
    Oracle® Database JDBC Developer's Guide and Reference
    10g Release 2 (10.2)
    I am trying to run a JDBC connection test to the 10g Rel 2 database per these instructions, and the verification of the installed directories fails. There is no /demo directory in ORACLE_HOME/jdbc, nor are there any jar files in the /lib directory except the ojdbc14 and ojdbc_14g ones. There is no /doc directory. There is no readme.txt. There is only ORACLE_HOME/jdbc/lib containing the ojdbc14 jar files (no classes12.jar or orai18n.jar).
    Basically, almost the entire verification as outlined in 2.2.1 at this page
    http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14355/getsta.htm#i1005373
    fails.
    Shouldn't all these files and directories have been installed?
    Any help appreciated.

    As David says, the version of Oracle you have installed has a reduced feature set. The entire Java subsystem has been left out to provide a lighter footprint.
    Please refer to the thread titled Strawman Feature Factoring List - Feedback requested (Strawman Feature Factoring List - Feedback requested to get a list of features currently in, and a discussion around possible changes.

  • SQL Developer crashing when opening or testing a connection

    SQL Developer closes abruptly when opening or testing a connection.
    Here's what I do.
    Open SQL Developer.
    Create a connection:
    Connection Name: [some string]
    Username: [username]
    Password: [password]
    Save password: checked
    Oracle tab:
    Connection type: TNS
    Connect Identifier: somedatabasename
    Then I click on "Test" and the application immediately quits. No error messages. The app does the same thing if I save the connection and try to expand its node on the list of connections.
    Mind you, if I use sqlplus like so:
    [username]/[password]@somedatabasename
    It connects just fine.
    I captured the output from the command console after SQL Developer crashed:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    C:\Oracle\product\sqldeveloper\sqldeveloper\bin>sqldeveloper
    _execv() failed, err=2Registered TimesTen
    # A fatal error has been detected by the Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006d9f97c5, pid=5480, t
    id=5840
    # JRE version: 6.0_43-b01
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64
    compressed oops)
    # Problematic frame:
    # V [jvm.dll+0x1397c5]
    # An error report file with more information is saved as:
    # C:\Oracle\product\sqldeveloper\sqldeveloper\bin\hs_err_pid5480.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    I am using:
    sqldeveloper 3.2.20.09.87 (64-bit)
    Java 1.6.0_43 (64-bit)
    Windows 7 Enterprise SP1 (64-bit)
    ODAC 11.2.0.3.20 x64
    Please help!
    Edited by: 993662 on Mar 13, 2013 9:10 AM

    @Jim:
    Thanks for your suggestion. After several hours of experimenting, I've managed to fix my problem by copying the ojdbc6.jar from my ODAC installation and replacing the one in [sqldeveloper root]\jdbc\lib
    To whomever has a similar issue: See my original post for what software I was using and their version numbers.
    Edited by: FrostyZoob on Mar 14, 2013 8:11 AM

  • Weblogic 7.0 , MySQL 3.23 JDBC Connection Pools

    i am using weblogic 7.0 and MySQL 3.23 and right now my objective is to create,
    configure and test a JDBC
    connection pool using the Administrative console.
    Here is what i have done till now
    - set the classpath of the MySQL driver in the startWLS.cmd like this
    SET MYSQL_DRIVER=C:\mysqldriver\mysql-connector-java-2.0.14\mysql-connector-java-2.0.14-bin.jar
    set CLASSPATH=%MYSQL_DRIVER%;%CLASSPATH%
    - using the weblogic administrative console i have created a new connection pool
    named as
    testpool.
    - Here is what i have in the testpool general tab
    Name: testpool
    URL: jdbc:mysql//localhost:3306/test (test is the name of the database in mysql)
    Driver Classname: org.gjt.mm.mysql.Driver
    I have not entered any Properties, ACL Name, Password or Open String Password.
    - Now i go the the Testing tab and enter a name of a table in my test database
    and click on Apply
    and on the command window i am getting the following exception
    java.sql.SQLException No suitable driver
    Thanks in advance,
    Ashish

    Thanks a lot Slava. After reading your mail and the post i was able to get it working.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ashish,
    I figured out what's the problem. URL in the connection pool
    definition is malformed. It's
    jdbc:mysql//localhost:3306/test
    while the correct one should have colon after mysql:
    jdbc:mysql://localhost:3306/test
    Regards,
    Slava Imeshev
    "Ashish Sureka" <[email protected]> wrote in message
    news:[email protected]...
    I am sorry, the program that i posted here is not comming properlyformatted but
    i am able to run a simple java program that connects to MySQL and alsoa
    servlet
    that connects to the MySQL. The only problem i am having is includingthe
    MySQL
    driver jar files to the weblogic server classpath.
    Thanks,
    Ashish.
    "Ashish Sureka" <[email protected]> wrote:
    Hello Joseph Weinstein,
    Actually, i already tried the same approach that you have mentioned
    in
    your reply
    before i posted my message here. Following is the program that i use
    to check
    MySQL connection.
    import java.sql.*;
    public class MySQLConnect
    public static void main(String[] args) throws Exception
    try {
    Class.forName ( "org.gjt.mm.mysql.Driver" );
    System.out.println ( "MySQL Driver Found" );
    } catch ( java.lang.ClassNotFoundException e ) {
    System.out.println("MySQL JDBC Driver not found ... ");
    throw ( e );
    String url = "";
    Connection con = null;
    try {
    url = "jdbc:mysql://" + "localhost:3306" + "/" + "test";
    con = DriverManager.getConnection(url);
    System.out.println("Connection established to " + url + "");
    } catch ( java.sql.SQLException e ) {
    System.out.println("Connection couldn't be established to " + url);
    String sqlStatement = "SELECT * FROM testtable";
    try {
    Statement s = con.createStatement();
    s.execute (sqlStatement);
    s.close ( );
    } catch ( SQLException e ) {
    System.out.println ( "Error executing sql statement" );
    con.close();
    The classpath that i use to run this program is
    SET PATH=C:\bea\jdk131_03\bin
    SETCLASSPATH=C:\bea\jdk131_03\jre\lib\rt.jar;C:\bea\weblogic700\ebcc\lib\ext\se
    rvlet.jar;C:\CSC413\Demos\HelloApp\HelloAppJAR
    SET CLASSPATH=%CLASSPATH%;C:\bea\weblogic700\server\lib\weblogic.jar
    SETMYSQL_DRIVER=C:\mysqldriver\mysql-connector-java-2.0.14\mysql-connector-java
    -2.0.14-bin.jar
    set CLASSPATH=.;%MYSQL_DRIVER%;%CLASSPATH%
    I have also written a Servlet which checks the MySQL connection. For
    the servlet
    i added the MySQL driver jar files in the WEB-INF/lib directory ofthe
    servlet
    web application and it is working fine.
    do you want me to attach the startWLS.cmd file that i changed to include
    the MySQL
    driver classpath.
    Thanks for your replies,
    Ashish.
    Joseph Weinstein <[email protected]> wrote:
    Ashish Sureka wrote:
    When i start the weblogic server using the command prompt by executingthe startWLS.cmd,
    i can see the classpath the server is using on the command window
    and
    that includes
    the jar file for the MySQL driver but still it is throwing a
    SQLException
    and
    saying that No Suitable driver.
    How do i include a external library or jar file on the weblogic
    server's
    classpath.
    is there a specific directory where i should put the MySQL driver
    jar
    file .
    Thanks,
    Ashish.No. Let's simplfy the problem. Please run a tiny standalone Java
    program
    that
    just makes a JDBC connection to your MySQL DBMS, with no weblogic
    code in the picture. When you succeed at this, show me the CLASSPATH
    and
    PATH of the shell that ran the program successfully, and show methe
    few lines
    of code that made the connection. Then we will know the problem.It
    may
    be that
    the URL you're passing to the pool is not exactly correct for that
    driver.
    Joe
    Joseph Weinstein <[email protected]> wrote:
    Ashish Sureka wrote:
    i am using weblogic 7.0 and MySQL 3.23 and right now my objective
    is
    to create,
    configure and test a JDBC
    connection pool using the Administrative console.
    Here is what i have done till now
    - set the classpath of the MySQL driver in the startWLS.cmd
    like
    this
    SET
    MYSQL_DRIVER=C:\mysqldriver\mysql-connector-java-2.0.14\mysql-connector-java
    -2.0.14-bin.jar
    set CLASSPATH=%MYSQL_DRIVER%;%CLASSPATH%
    - using the weblogic administrative console i have created anew
    connection
    pool
    named as
    testpool.
    - Here is what i have in the testpool general tab
    Name: testpool
    URL: jdbc:mysql//localhost:3306/test (test is the name of
    the
    database
    in mysql)
    Driver Classname: org.gjt.mm.mysql.Driver
    I have not entered any Properties, ACL Name, Password or
    Open
    String
    Password.
    - Now i go the the Testing tab and enter a name of a table in
    my
    test
    database
    and click on Apply
    and on the command window i am getting the following exception
    java.sql.SQLException No suitable driverWatch the first lines that the server prints out when the script
    starts
    it. The script
    shows the classpath that was constructed for the server. It is
    likely
    that you need
    to do something else to ensure your driver is really in the classpath
    the server uses.
    Joe
    Thanks in advance,
    Ashish

  • Jdbc connection in EJB using wsad 5.0

    Hi,
    I want to develop a small application using Ejbs by using oracle 9i as D/b, wsad 5.0 as app server . The problem is i am not able to connect to oracle database in WSAD. What i am doing is i have installed Oracle 9i in my system and has given the Global database name as "samp" while installation . I open my SQL plus with username scott and password tiger and i am able to do all my sql queries successfully.
    Now coming to WSAD,
    while creating a JDBC connection using Oracle 9i driver,
    i ve opened in Data perspective and in that go to DB Servers -> Right click -> New Connection
    There a window is opened for Database Connection.
    We need to fill the fields there.
    I have given samp as Global d/b name while installing Oracle 9i .
    In the window , the feilds are
    Connection Name : conn
    Database Name : samp
    user id : scott
    password : tiger
    D/b vendor type: Oracle 9i
    Jdbc Driver : Oracle Thin Driver
    Host : 127.0.0.1
    port No: 1521
    class location : c:\oracle\ora90\jdbc\lib\classes12.zip
    connection url : jdbc:oracle:thin:@127.0.0.1:1521:samp
    the class location and connection url are automatically coming.
    and please check whether all fields are correct or not
    Is this the correct way.
    Next in code if i want to connect to database should i use connection establish commands again or i can directly use create statement or prepare statement.
    Please reply.
    Thanks

    Create New Server and configure it properly
    It will work
    procedure is as follows:
    Pls visit the following link:
    http://www.webagesolutions.com/knowledgebase/waskb/waskb001/index.html
    Adding a Oracle9i DataSource from WSAD5
    Bibhas Bhattacharya, Web Age Solutions Inc.
    Before you begin, make sure that you have Oracle installed and a database is created. In this document we will use a database called MALL.
    Create a WAS V5 Server
    If you don't already have a WebSphere V5 server created, do so following these steps. Switch to the Server perspective. Right click in the Server Configuration view and select New->Server and Server Configuration.
    Name the server WASV5. Make sure that the Server type is set to WebSphere version 5.0->Test Environment. Click on Finish.
    Add the Database User
    In WSAD5, the default user ID and password to be used by a DataSource are first entered as a JAAS authentication entry.
    In the Server Configuration view, double click on WASV5 to open the configuration editor. Click on the Security tab. Next to the JAAS Authentication Entries list click on Add and add the user.
    Add the JDBC Driver
    Still in the server configuration GUI click on the DataSource tab. You can add the DataSource at the server level or at the node level. We will add it at the server level. Make sure that the Server Settings is expanded. Next to the JDBC providers list click on Add.
    Select the following options:
    Database type: Oracle
    JDBC provider type: Oracle JDBC Thin Driver or the XA version of it if you need two phase commit transaction.
    Click on Next.
    Set the name to Oracle Thin Driver.
    Notice that the location of the driver's class is automatically set to ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip. Here, ORACLE_JDBC_DRIVER_PATH is a node level variable. We need to make sure that the variable is pointing to the correct directory where Oracle's JDBC driver is installed. In our case, we had installed Oracle in c:\oracle. This had installed the JDBC driver class in C:/oracle/ora81/jdbc/lib/classes12.zip.
    In the server configuration GUI click on the Variables tab. Under the Node settings select ORACLE_JDBC_DRIVER_PATH from the Defined variables list. Click on Edit and set the value to C:/oracle/ora81/jdbc/lib.
    Add the DataSource
    Click on the DataSource tab again. Select the Oracle Thin Driver you had created in the previous step. Click on Add next to the Data source defined in the JDBC provider selected above list.
    Select the following options:
    Select the type of JDBC Driver: Oracle JDBC Thin Driver.
    Select the data source type: Unless you will be testing your application with WAS V4, select Version 5.0. You can not use a V4 DataSource from a J2EE 1.3 EJB module running in WebSphere V5.
    Click on Next.
    Enter these key attributes in this screen:
    Name: My Oracle DataSource
    JNDI Name: jdbc/MyDataSource
    DataSource helper class name: com.ibm.websphere.rsadapter.OracleDataStoreHelper. Should be selected by default. The helper class is needed if you wish to access IBM extensions to JDBC. For more details search in WSAD help for "WSDataSource interface".
    Component-managed authentication alias: Set this if you wish to lookup the DataSource using its global JNDI name or using the java:comp/env/ name space and have set the authentication type of the resource reference to Application. Select the JAAS entry you had created. That is, Database user.
    Container-managed authentication alias: Set this if you intend to lookup the DataSource using the java:comp/env/ name space and have set the authentication type of the resource reference to Container. Select the JAAS entry you had created. That is, Database user.
    Use this data source in container managed persistence (CMP): Check on if you intend to use the DataSource from CMP EJBs.
    Click on Next.
    You need to set these properties:
    databaseName: MALL in our case.
    URL: jdbc:oracle:thin:@noble.webagesolutions.com:1521:MALL. In my case the server host name is noble.webagesolutions.com. The listener port number is 1521 (usually the default in most Oracle installations).
    Click on Finish.
    You have finished adding the DataSource. Save the server settings by clicking Control+S. Close the server configuration GUI.
    Testing the DataSource
    There is no out of the box way to test the DataSource. You can create a simple Servlet and add the following code:
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    javax.sql.DataSource ds = null;
    java.sql.Connection con = null;
    java.io.PrintWriter out = resp.getWriter();
    resp.setContentType("text/html");
    try {
    out.println("Looking up DataSource<br>");
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    ds = (javax.sql.DataSource) ctx.lookup("jdbc/MyDataSource");
    out.println("Getting connection<br>");
    con = ds.getConnection();
    con.close();
    } catch (Exception e) {
    e.printStackTrace(out);
    out.println("Done<br>");
    Feedback
    Your e-mail:
    Rate this article:
    Very useful Somewhat useful Not bad Needs many corrections
    Comments:

  • JDBC CONNECTIONS RECURSIVE WAY

    JAVA DEVELOPER COMUNITY
    I request your help in the following topic,
    i am doing a java program that store a
    complete file system in an Oracle Database 11GR2.
    So i use a recursive algorithm to do that
    but i don't know how to handle the JDBC
    connections in order to not overload the total of
    physical connections available to the database.
    Thanks for your help.
    Regards from Colombia - South America
    JOHN JAIRO GOMEZ LAVERDE
    I am using the following code:
    import java.io.* ;
    import java.sql.*;
    import java.lang.String;
    import java.util.Date;
    import java.util.Calendar;
    import java.util.*;
    import java.text.SimpleDateFormat;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    import javax.naming.*;
    import javax.naming.spi.*;
    public class InsertArcDir
    public void AddFiles( File file )
    try
    Calendar fechamod=Calendar.getInstance();
    String SQL;
    PreparedStatement pstmt = null;
    java.util.Properties prop = new java.util.Properties();
    prop.setProperty("MinLimit", "2");
    prop.setProperty("MaxLimit", "10");
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("jdbc:oracle:thin:@//oracle:1521/xe");
    ods.setUser("hr");
    ods.setPassword("hr");
    ods.setConnectionCachingEnabled(true);
    ods.setConnectionCacheProperties (prop);
    //ods.getConnectionCacheName();
    Connection conn = ods.getConnection ("hr","hr",prop);
    Statement stmt = conn.createStatement();
    fechamod.setTimeInMillis(file.lastModified());
    SQL="INSERT INTO tbarchivos(nombrearc,fechaarc,direcarc) VALUES(?,?,?)";
    pstmt = conn.prepareStatement(SQL);
    java.sql.Timestamp sqlDate = new java.sql.Timestamp(fechamod.getTimeInMillis());
    pstmt.setString(1, file.getName());
    pstmt.setTimestamp(2, sqlDate);
    pstmt.setString(3, file.getParent());
    pstmt.executeUpdate();
    stmt.close();
    conn.close();
    catch(Exception e)
    System.out.println("Exepcion"+e.getMessage());
    System.out.println("OTHER TEST");
    * Works on a single file system entry and
    * calls itself recursively if it turns out
    * to be a directory.
    * @param file A file or a directory to process
    public void traverse( File file )
    // Check if it is a directory
    if( file.isDirectory() )
    // Get a list of all the entries in the directory
    String entries[] = file.list() ;
    // Ensure that the list is not null
    if( entries != null )
    // Loop over all the entries
    for( String entry : entries )
    // Recursive call to traverse
    traverse( new File(file,entry) ) ;
    else
    if(file.isFile())
    InsertArcDir rta = new InsertArcDir() ;
    rta.AddFiles(file);
    else
    System.out.println("*** VALOR INCORRECTO ***");
    //try
    //stmt.close();
    //conn.close();
    //catch(Exception e)
    // System.out.println("Exepcion"+e.getMessage());
    * The program starts here.
    * @param args The arguments from the command line
    public static void main( String args[] )
    try
    java.util.Properties prop = new java.util.Properties();
    prop.setProperty("MinLimit", "2");
    prop.setProperty("MaxLimit", "10");
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("jdbc:oracle:thin:@//oracle:1521/xe");
    ods.setUser("hr");
    ods.setPassword("hr");
    ods.setConnectionCachingEnabled(true);
    ods.setConnectionCacheProperties (prop);
    ods.setConnectionCacheName("ImplicitCache01");
    Connection conn = ods.getConnection ();
    conn.close();
    //Statement stmt = conn.createStatement();
    // Create an object of this class
    InsertArcDir rt = new InsertArcDir() ;
    if( args.length == 0 )
    // If there are no arguments, traverse the current directory
    rt.traverse( new File(".") ) ;
    else
    // Else process every argument sequentially
    for( String arg : args )
    rt.traverse( new File(arg) ) ;
    //stmt.close();
    //conn.close();
    catch(Exception e)
    System.out.println("Exepcion"+e.getMessage());
    *********************

    I will not comment on weather or not to use recursion. However, I suggest:
    This statement and its configuration should occur once in your program and not in a recursive function:
    OracleDataSource ods = new OracleDataSource();
    Assuming your using connection pooling, get a connection, use it, and close it as quickly as possible for each write to the database (not the best solution, but good enough for now until you read up on JDBC). Do not hold onto the connection for the duration of the application.
    Conection pooling is designed to allow you to get and close a connection with minimal performance loss. I suggest reading up on JDBC, or better yet reading a book on JDBC.

  • Why my MySQL JDBC Connect fail??

    Dear friends:
    I have following code:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class JdbcExample2 {
      public static void main(String args[]) {
        Connection con = null;
        try {
          Class.forName("com.mysql.jdbc.Driver").newInstance();
          //jdbc:mysql://host_name:port/dbname
    //     con = DriverManager.getConnection("jdbc:MySQL:///test","admin", "admin");
          con = DriverManager.getConnection("jdbc:MySQL://localhost:3306/test","admin", "admin");
          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) {}
    }But when I run , I got following error:
    Exception: com.mysql.jdbc.Driver
    My question is:
    [1]. when I connect to MySQL Server through mySQL Client, I got
    Enter password: *****
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 18 to server version: 4.1.21-community-nt
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql>
    how Can I determine MySQL Server name?? I forgot when I install, maybe MySQL is my SQL Server name
    [2]. Do I need to creat a user DSN name or System DSN name for MySQL Server?? which one is best??
    How to do it??
    [3]. How to make above simple JDBC program runnable??
    Thanks
    sunny
    Message was edited by:
    sunnymanman

    Thanks, see new errors:
    C:\Project\java>java Jdbc11
    Copyright 2004, R.G.Baldwin
    java.sql.SQLException: Access denied for user 'admin'@'localhost' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:868)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3340)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1238)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2743)
    at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at Jdbc11.main(Jdbc11.java:23)
    C:\Project\java>
    any idea??
    here Jdbc11.java:23 is:
    Connection con = DriverManager.getConnection(
    url,"admin", "YES");
    my userID/Password = admin/admin;
    sunny
    Message was edited by:
    sunnymanman

  • Error while creating a report that uses Oracle OCI JDBC connectivity

    Please let me know why my CR and LF characters are removed from my forum posting *****
    Hi,
    I was trying to create a report that uses Oracle OCI JDBC connectivity. I am using Eclipse3.4 download from "cr4e-all-in-one-win_2.0.2.zip".  I have successfully created a JDBC OCI connection.
    The connection parameters are given below:
    URL: jdbc:oracle:oci8:@xe
    Database: xe
    username: <userName>
    password: <password>
    I have tested the above connection in Data source Explorer and it works fine!!!
    But I am getting the following error when I drag-and-drop a table from the list of tables. Not sure what I am missing here?  Any help is highly appreciated.
    com.businessobjects.reports.jdbinterface.common.DBException: InvalidURLOrClassName
         at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
         at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123)
         at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1771)
         at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:491)
         at com.crystaldecisions.reports.queryengine.Connection.t1(SourceFile:2979)
         at com.crystaldecisions.reports.queryengine.Table.u7(SourceFile:2408)
         at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(SourceFile:529)
         at com.crystaldecisions.reports.common.CommandManager.a(SourceFile:71)
         at com.crystaldecisions.reports.common.Document.a(SourceFile:203)
         at com.businessobjects.reports.sdk.requesthandler.f.a(SourceFile:175)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(SourceFile:1079)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1163)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:657)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:163)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:525)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:523)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$3.doWork(ExecutorWithIdleProcessing.java:182)
         at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityTask.run(PriorityTask.java:75)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.runSubtask(PriorityCompoundCancellableRunnable.java:187)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityProgressAwareRunnable.runSubtask(PriorityProgressAwareRunnable.java:90)
         at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.doWork(PriorityCompoundCancellableRunnable.java:144)
         at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
         at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$IdleTask.run(ExecutorWithIdleProcessing.java:320)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Thanks
    Karthik
    Edited by: KARTHIK1 on Oct 14, 2009 9:38 PM

    Hi Ted,
    Thanks for the feedback. I was able to create a report in Creystal Reports Designer 2008 using OCI.  It is not allowing only in the Eclipse plugin. In our environment we are not allowed to user Oracle thin connections and ONLY OCI is allowed.
    1) Can you please let me know if there is a way to do this? 
    2) Will it allow data sources using native database driver?
    3) If so, can I use JRC to create these reports from a desktop java program?
    Thanks & Regards
    Karthik
    Edited by: KARTHIK1 on Oct 15, 2009 4:38 PM

  • Issue JDBC connection pool with Glassfish 3.1.2.2 and Oracle XE 11gR2

    Hello,
    I am experiencing an issue with pinging a JDBC connection Pool.
    I installed the following without any warnings or errors:
    Operating System: Oracle Enterprise Linux 5
    Oracle XE 11gR2 (11.2.0.2.0) database
    Glassfish 3.1.2.2
    I will refer to the steps I did after the installations
    1) In the .profile file of the OS I add the following:
    JRE_HOME=/usr/java/jre1.6.0_31; export JRE_HOME
    JAVA_HOME=/usr/java/jdk1.6.0_31; export JAVA_HOME
    GLASSFISH_DIR=/u01/glassfish3
    GLASSFISH_HOME=/u01/glassfish3/glassfish
    DERBY_HOME=$GLASSFISH_DIR/javadb
    OPEN_MQ_HOME=$GLASSFISH_DIR/mq
    PATH=:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HOME/bin:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
    export GLASSFISH_HOME
    export DERBY_HOME
    export OPEN_MQ_HOME
    export PATH
    LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib; export LD_LIBRARY_PATH
    . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
    2) I copied the ojdbc6.jar to the $GLASSFISH_HOME/domains/domain1/lib
    3) I login to the Glassfish admin console and created a new JDBC Connection Pool.
    Pool Name: ds_orasys
    Resource Type: javax.sql.DataSource
    Datasource Classname: oracle.jdbc.pool.OracleDataSource
    User: [myschema]
    Password: [myschema password]
    URL: jdbc:oracle:thin:@localhost:1521:xe
    When I ping the connection pool I get the following message in the server log:
    [#|2012-10-23T12:14:37.069+0300|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=22;_ThreadName=Thread-2;|RAR8054: Exception while creating an unpooled [test] connection for pool [ ds_orasys ], Connection could not be allocated because: Invalid Oracle URL specified|#]
    [#|2012-10-23T12:14:37.071+0300|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=19;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://212.205.62.217:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=ds_orasys}'|#]
    I tried to use different jar files. I used ojdbc6dms.jar and ojdbc14.jar.
    I also copied the jar files in the $GLASSFISH_HOME/domains/domain1/lib/ext directory as some people suggested. Still no luck. I keep getting the same error messages in the server.log
    Can anybody help me out or point me to the right direction.
    Thank you in advance

    The error is in the URL. It was in front of my eyes and I couldn't see the error. I skipped the ':' before the '@' when I created the pool. It is working fine now.

  • JDBC Connection pool recovery after DB server restart

    I am finding that Kodo is throwing the following exception after I restart
    my database server (mysql). I am doing the database server restart while my
    application server is idle, so it is not during a transaction.
    Communication link failure: java.net.SocketException [code=0;state=08S01]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    This is presumably due to the JDBC connection pooling. Is there a
    configuration setting that allows Kodo to detect such failures and reconnect
    to the database server without exposing this problem to the application
    code? For example, WebLogic Server's JDBC connection pool has a setting that
    enables testing a connection and recovering from such failures before
    allocating it from the pool.
    Ben

    This is presumably due to the JDBC connection pooling. Is there a
    configuration setting that allows Kodo to detect such failures and reconnect
    to the database server without exposing this problem to the application
    code?Not right now. You can log an enhancement request with our bug database:
    http://bugzilla.solarmetric.com/

  • JDBC connection pool failures when used by JMS stores

              We are using WebLogic 6.1 sp2. We defined a separate connection pool for use by
              a JMS Store.
              <JDBCConnectionPool Name="sybaseJMSPool"
              Targets="cluster00"
              InitialCapacity="2"
              MaxCapacity="10"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;charset=utf8"
              URL="jdbc:sybase:Tds:@jms.db.host@/@jms.db.name@"/>
              (note that the @xxx@ string are replaced by actual values).
              We are using Sybase Jconnect 5.5 to a Sybase ASE 12.5 database.
              We deployed this configuration on a number of environments (testing, staging,
              ..). The actual hardware and network configuration is different for the different
              system, but the WebLogic domain stays the same regarding this issue.
              On the test system we frequently get the following exceptions:
              <Aug 13, 2002 1:56:04 PM CEST> <Alert> <JMS> <www00-test> <node00>
              <ExecuteThread: '6' for queue: 'JMS.TimerClientPool'> <> <> <040048>
              <JMSServer "JMSServer00", store failure while writing message for topic
              OrderChangeTopic, java.io.IOException: JMS JDBC store, connection pool =
              <sybaseJMSPool>, prefix = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              .>
              java.io.IOException: JMS JDBC store, connection pool = <sybaseJMSPool>, prefix
              = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              at weblogic.jms.store.JDBCIOStream.throwIOException
              (JDBCIOStream.java:1213)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1256)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Before that this message appeared:
              <Aug 13, 2002 11:31:16 AM CEST> <Error> <ConnectionManager> <www00-test>
              <node00> <ExecuteThread: '26' for queue: 'default'> <> <> <000000>
              <Closing: 'weblogic.rjvm.t3.T3JVMConnection@795af6' because of: 'Server
              received a message over an uninitialized connection: 'JVMMessage from: 'null'
              to: '-4555218188801970213S:192.168.13.1:[7001,7001,7002,7002,7001,7002,-
              1]:ADIS:node00' cmd: 'CMD_REQUEST', QOS: '101', responseId: '1',
              invokableId: '287', flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev
              offset: '34'''>
              This problem did not occur on another system which was used during a 2 day stress
              testing session.
              It seems that the problem occurs after a period in which no user request where
              made. The user requests trigger EJB's that start sending JMS messages.
              When the problem occurs, the JMS messaging systems seems to lock up as no messages
              are received anymore by the different listeners (MDBs).
              Undeploying and redeploying the JBDC connection pool solves the problem. This
              solution is unacceptable in case of a production system.
              A similarly defined connection pool, which is used by the EJBs to make database
              connection, does not manifest this problem.
              <JDBCConnectionPool Name="sybasePool"
              Targets="cluster00"
              InitialCapacity="10"
              CapacityIncrement="5"
              MaxCapacity="50"
              PreparedStatementCacheSize="150"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;JCONNECT_VERSION=6;charset=utf8"
              URL="jdbc:sybase:Tds:@db.host@/@db.name@"/>
              The JDBC connection pool is used as follows by the JDBC store
              <JMSJDBCStore ConnectionPool="sybaseJMSPool" Name="JDBCStore00" PrefixName="JMS00"/>
              <JMSServer Name="JMSServer00" Store="JDBCStore00" Targets="node00">
              <JMSTopic JNDIName="ADIS.JMSError" JNDINameReplicated="false" Name="ErrorTopic"/>
              <JMSTopic JNDIName="ADIS.Status"
              Name="StatusTopic" RedeliveryDelayOverride="300000"/>
              <JMSTopic JNDIName="ADIS.OrderChange" JNDINameReplicated="false"
              Name="OrderChangeTopic" RedeliveryLimit="3"/>
              </JMSServer>
              Turning on the "Test Reserved Connection" with a appropriate test table does not
              help.
              Some sources on the internet tell us that JZ0C0 errors in the Jconnect driver
              can be related to network problems. Nevertheless the connection pool should be
              able to cope with this.
              Can you provide any solution for this ? Or give us hints what can cause the problem
              

    Zhenhao Qi wrote:
    thanks! Joe.
    The SQL statement itself can no longer be simplified, the long excuation time is due to the database size and complicated Select criteria. I can easily reproduce the problem by using this SQL. I tried "BEA's Oracle driver (Type 4): Version 8.1.7,9.0.1,9.2.0". the question can be dissect into 2 pieces:
    1) why the jdbc connection (using oracle.jdbc.OracleDriver) won't return anything if the SQL execution time > 5min, that is probably the Oracle's problem
    2) why the occupied connection pool won't release even I set "Statementtimeout=600", this is Weblogic's problem.
    ZhenhaoHi. Yes, (1) is oracle's problem. (2) may also be. The JDBC spec has very few
    allowances for one thread to interrupt a second thread's JDBC call. If we
    transmit your timeout request by calling setQueryTimeout() on the oracle
    statement, and if you have a weblogic-controlled transaction we call
    Statement.cancel() on any ongoing statement, we end up relying on whether
    the Oracle driver implements and responds to those calls.
    Are you doing weblogic-controlled transactions? Are you/can you
    call Statement.setQueryTimeout() on your statements, or are these
    generated JDBC queries?
    If you can duplicate the problem using the weblogic.jdbc.oracle.OracleDriver
    we have some other debug avenues. This would be good even if you really
    want to use the thin driver, because we will do the same JDBC calls to
    either driver, and the debug would prove (if) we set up a query timeout
    and if we call cancel(). If we do, then we can know that it is the Oracle
    driver failing in these regards.
    Joe

  • Issues with JDBC Connection Pooling

    Hi all,
    I'm experiencing some unexpected behaviour when trying to use JDBC Connection Pooling with my BC4J applications.
    The configuraiton is -
    Web Application using BC4J in local mode
    Using Default Connection Stagegy
    Stateless Release Mode
    Retrieving Application Modules using Configuration.createRootApplicationModule( am , cf );
    Returning Application Modules using Configuration.releaseRootApplicationModule( am, false );
    Three application modules
    AppModuleA - connects to DatabaseConnection1
    AppModuleB - connects to DatabaseConnection2
    AppModuleC - connects to DatabaseConnection2
    My requirement is to -
    Use App Module Pooling and have individual pool for each Application Module
    Use JDBC Pooling and have individual pool for each Database connection
    Note: All configuration was achieved in design mode (i.e. right clicking AppModule->Configurations...)
    1. Initial approach -
    In the configuration for each Application Module I specified the connection type as 'JDBC Datasource' and specified to approriate datasource.
    Tried setting doConnecitonPooling to 'true' as well as 'false'
    In the data-sources.xml I specified all the appropriate info including min-connections and max-connections.
    I would expect, with the above config that BC4J would use OC4J's built in JDBC connection pooling.
    2. Second approach -
    In the configuration for each Application Module I specified the connection type as JDBC URL.
    In the configuration I specified doConnectionPooling = 'true' as well as the max connection, max available and min available
    What I experienced in both cases was that the max connections seem to be ignored as the number of connection as reported by the database (v$session) was exceeded by more than 10.
    In addition to this once the load was removed the number of JDBC connecitons did not drop (I would have expected it to drop to max available connections)
    My questions are -
    1. When specifying to use a 'JDBC Datasource' style of connection, is it in fact OC4J that is then responsible for pooling JDBC connections? And in this case should BC4J's doConnectionPooling parameter be set to true or false?
    2. Are there any known issues with the use of the JDBC Conneciton Pool as stated by the above to approaches?

    Thanks for the additional info. Please see my comments. below.
    Sorry should have been more specififc -
    1. Is each application pool using a different JDBC user? You mentioned DatabaseConnection1 and DatabaseConnection2
    above; are these connections to different schemas / users? If so, BC4J will create a separate connection pool for each
    JDBC user. Each connection pool will have its own maximum pool size.
    Each 'DatabaseConnection' refers to a different database, actually hosted on a seperate physical server, different
    schema and different user.BC4J will maintain a separate connection pool for each permutation of JDBC URL / schema. If each user is connecting
    to a different DB instance then I would expect no greater than 10 DB sessions. However, if a DB instance is hosting
    more than user then I would expect greater than 10 DB sessions (though still no more than 10 DB sessions per user).
    2. Are all the v$session sessions related to the JDBC clients? There should be at least one additional database
    session which will be related to the session that is querying v$session.
    When querying the v$session table I specifically look for connections from the user in quesiton and from the machine
    name in question and in doing so eliminate the database system's connections, as well as the query tools'
    connection. One area I'm not sure about is the connection BC4J uses to write to its temporary tables. I am using
    Stateless release mode and have not explicetly stated to save to the database but I'm wondering if it still does if so
    and how does it come into the equation with max connections?BC4J's internal connections are also pooled and the limits apply as mentioned above. So, if you have specified
    internal connection info for a schema which is different than the users above I would expect the additional conns.
    One helpful diagnostic tool, albeit programmatic, might be to print the information about the connection pools after
    your test client(s) have finished. This may be accomplished as follows:
    // get a reference to the BC4J connection pool manager
    import oracle.jbo.server.ConnectionPoolManagerFactory;
    import oracle.jbo.server.ConnectionPoolManagerImpl;
    import oracle.jbo.pool.ResourcePool;
    import java.io.PrintWriter;
    import java.util.Enumeration;
    // get the ConnectionPoolManager. assume that it is an instance of the supplied manager
    ConnectionPoolManagerImpl mgr = (ConnectionPoolManagerImpl)ConnectionPoolManagerFactory.getConnectionPoolManager();
    Enumeration keys = mgr.getResourcePoolKeys();
    PrintWriter pw = new PrintWriter(System.out, true);
    while (keys.hasMoreElements())
    Object key = keys.nextElement();
    ResourcePool pool = (ResourcePool)mgr.getResourcePool(key);
    System.out.println("Dumping pool statistics for pool: " + key);
    pool.dumpPoolStatistics(pw);
    }

Maybe you are looking for

  • Error while changing PO in SRM extended classic Version 5.0

    Hi Guys, we are facing issue while changing PO in SRM , this is extended classic with version 5.0. The system status is active() is error message and PO remains unchanged. Kindly help to resolve this issue. we have an approval for even PO if a user c

  • Installing Snow Leopard in the Mac Store?

    Would I need an apple care plan to let the mac store install a fresh copy of Snow Leopard on my computer because I'm getting a computer that has kernal panics.

  • Syntex_Error during SAPKB70012

    Dear Team, I am updating my basis KB70012 support pack in my IDES server. But now when i executing any t code . its give abap dump i.e  SYNTEX_ERROR.In This Syntax error in program "SAPLKKBL ". I have check the log in trans . It give below messege WA

  • Problems with Sql Developer

    Hi, I install Sql developer version 1.2.1.3213, when I try to configure the connection I got the error -java.lang.NullPointerException. Please how ca I fix this problem or why this happened. Thanks

  • # instead of initial value in reports

    Hi, I'm trying to solve the following problem: When I create a report in Query Analyzer, in some columns, instead of the initial value(spaces) for some fields, there is the  # sign. Do you know from where does this issue come from? Is there an option