Reuse of preparedstatements and the connection pool

It seems useful (for performance reasons) to reuse a prepared statement in
subsequent calls to the database. In WebLogic, however, after each call we
return the Connection object to the WebLogic connection pool. A prepared
statement is created on a specific Connection object. The next time we want
to use the same query we get a Connection from the pool, which might be
another instance of the Connection class. Therefor it seems impossible or at
least dangerous to reuse the same prepared statement. Even in the case this
would work we're indirectly using the other Connection, which we already
returned to the pool and which could be retrieved from the pool by someone
else. So, can't we reuse preparedstatements ?

Hi Raja,
Currently the only bullet-proof way to make sure that all statements are
cached is to set the cache size to a number of possible prepared statements
in the application.
The only consequence of increased cache size is growing amount of
memory required by a server instance.
Regards,
Slava Imeshev
"Rajiv Jauhari" <[email protected]> wrote in message
news:[email protected]...
Is there an easy way to tell whether the prepared statement cache size one
has set is
appropriate? Some way to monitor cache hit rate or usage count (i.e., the
actual number of statements cached) while running a load test? I'm using
Weblogic 6.1sp3 and Oracle 8.1.7.4.
Another way to think of this question is: is there a negative impact ifthe
cache size is set too large?
In the case of Oracle I believe one might run out of cursors, but is there
any other negative consequence that you know of?
Thanks,
Rajiv
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Vyas wrote:
If multiples (of the same statement) can be cached would it not result
in too many
prepared statements of the same type in the cache ?
This could happen
1. When a load test is done when all the threads start doing exactly
the
same work.
Because of contention everybody gets their own statement copy(theoritically, even
if in practice it may not exactly happen like that). In such a case
you
are going
to create load on the database in terms of open cursors.Each thread will get it's own connection, and the statement cache isper-connection.
Cursors, in Oracle's case, do need to be configured to support acache-full of
retained statements. Alternately, the cache should be set to a smallenough size to
require only as many cursors as the DBMS will allow per connection.
Another issue is what happens when the cache limit is hit ?
In the above example let's say cache limit is 50 and I am doing 50
user
load test.
because of load test let's say the cache gets filled with 50 of the
same
statement.
When load test moves to the next sequence of action requiring a
diffrent
statement
what happens to the cache ?
thanks
VyasThe only way a given connection's statement cache will get a duplicatestatement
is if some single JDBC thread required multiple copies of the samestatement. A
multi-user test will usually just ensure that each pooled connectioncaches the
same selection of different statements that the test user used. If thetest user
just repeatedly makes and uses one statement, the first time they do it,the
statement will be cached, and every subsequent repeat of the user codewill get
the same cached statement. The cache will still have 49 empty slotswaiting for
different statements. Currently the cache is simple-minded. It is a
fixed
(configurable)
size per connection, and the first N prepared/callable statements getcached for the
life of the pooled connection that created them. All other subsequentstatements will
be made and closed on a per-connection-use basis. Therefore, it can bethat a startup
or stress load that runs before standard runtime service, and which usessignificantly
different a statement profile could populate the cache with rarely-usedwasted statements.
If I were a customer in this circumstance, I would either prime thecaches, by determining
which statements I wanted cached, and then running a startup class thatreserved all the
pool connections, and made these statements on each before closing them.Alternately,
after startup/stress I would reset the pool, and allow the runtime load
to
fill the cache of
the regenerated pool.
Joe Weinstein at B.E.A.
thanks
Vyas
Joseph Weinstein <[email protected]> wrote:
JS wrote:
It seems useful (for performance reasons) to reuse a prepared
statement
in
subsequent calls to the database. In WebLogic, however, after each
call
we
return the Connection object to the WebLogic connection pool. A
prepared
statement is created on a specific Connection object. The next timewe
want
to use the same query we get a Connection from the pool, which
might
be
another instance of the Connection class. Therefor it seemsimpossible
or at
least dangerous to reuse the same prepared statement. Even in the
case
this
would work we're indirectly using the other Connection, which we
already
returned to the pool and which could be retrieved from the pool bysomeone
else. So, can't we reuse preparedstatements ?We already have you covered! Weblogic caches PreparedStatements along
with the pooled connection they came from. Every time you obtain a
pool
connection and run a prepareStatement() or prepareCall(), we willtransparently
give you a previously made statement, if the SQL exactly matches, andno
other place in the current thread stack is using that statement(multiples
can
be cached)
You are correct, of course, that statements you have should only
be
useable
to you while you have the connection from which they came. We have
you
covered
there too. If you were to try to use any prepared statement that
you'd
gotten
from
a pool connection after you'd put the connection back into the pool,those
statements
would throw an exception saying that they had been made inoperable atthe
time
you'd closed the connection.
Joe Weinstein at B.E.A.

Similar Messages

  • Application Server and Driver  Connection Pool

    Hi,
    What is the difference between Connection Pool implemented by the Driver and the Connection Pool implemented by the Application Server?
    If i am using a JDBC3.0 compliant driver,i can use PooledDataSource to get a Conenction from the Connection pool. But, even otherwise, the application server (JBOSS) would implement a Connection Pooling mechanism. i.e even from a basic Datasource, i will get the Connection Pool.
    1. Can i do away with PooledDataSource of Driver when using an application server?
    2. If i have to use both, then what is the criterion for optimal usage?
    Can someone answer this please...
    If there is some reference available on this topic, please let me know.
    Thanks in Advance

    Connection pooling is good that the connection object that have been created can be used later by other client.
    Application server is better since server always have more resources( such as memory, processor speed) in order to perform the task.
    And this may improve centralization, all connection object managed by a single centralized server.
    Pls correct me if i am wrong.

  • Possible to detect if a connection was fetched from the connection pool?

    Is there any way to differentiate between newly opened connections and connections that came from the connection pool? It would have to work without requiring a round trip to the server because I'd only use it to optimize away a procedure call that I now have to do for every connection that is opened.
    If the answer is different for the classic provider and the fully managed one, please provide both.

    @Op. What you are trying to do can't be done.

  • How can I use the Connection Pool with DB2

    Hi All,
    I am facing the problem with the usage for the Connection Pool.
    I want to use DB2 via JNDI lookup.
    But when starting the Weblogic server, Error occured with the following message.
    <Error> <JDBC> <Cannot startup connection pool "MyJDBCPool" Cannot load driver class : com.ibm.db2.jdbc.app.DB2Driver>
    DB2 and Weblogic are on the same machine.
    In case of the use of remote DB2 database, I also encountered the same error.
    Configurations are as follows.
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver"
    MaxCapacity="10" Name="MyJDBCPool"
    Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test" URL="jdbc:db2://localhost:6789/yongjoo"/>
    <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool" Targets="myserver"/>
    Could you please give some information about this problem? I will appreciate your kindness.

    Hi Joe,
    Thanks your help.
    Perhaps It's my fault for Weblogic console's setting.
    After I reset the target server in console, Error message disappeared.
    But, when I call the TestCode, I encountered another error message. The error
    is NameNotFoundException.
    When lookingup the JNDI name, NameNotFoundException errer occured. I tried to
    change my setting and JNDI name, but the results are the same.
    Would you please give me some information about this one more time? I will be
    appreciated for your help.
    Follows are Config.xml
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver" MaxCapacity="10"
    Name="MyJDBCPool" Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test"
    URL="jdbc:db2://localhost:6789/yongjoo"/> <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool"
    Targets="myserver"/>
    and follows are TestCode,
    url = "t3://localhost:7001"; //default URL
    datasource = "jdbc/acsdb";
    Context ctx = null;
    Hashtable p = new Hashtable();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, url);
    try{
    ctx = new InitialContext(p);
    System.err.println("initialContext(p)"+ctx); <-- success
    ds = (DataSource)ctx.lookup("java:comp/env/jdbc/acsdb");
    }catch(NameNotFoundException ne){
    throw new ConnectionException(); .
    }catch(NamingException ne){
    throw new ConnectionException();

  • The connection pool does not exist?

    Can somebody tell what is happening? For some reason the Sun Java Application Server 8 seems to think that there is no connection pool. For a moment everything worked. I did not change the configuration but now I get this message (if I open the admin console and ping the Connection Pool its there). Here is a part of the server.log file:
    [#|2006-05-06T19:12:54.453+0300|WARNING|sun-appserver-pe8.1_02|javax.enterprise|_ThreadID=10;|UTIL5047: Connection Pool does not exist: [DB2 yhteysConnectionPool]|#]
    [#|2006-05-06T19:12:54.453+0300|WARNING|sun-appserver-pe8.1_02|javax.enterprise|_ThreadID=10;|UTIL5048: Error Loading Jdbc Resource: [jdbc/aarre]|#]
    [#|2006-05-06T19:12:54.453+0300|INFO|sun-appserver-pe8.1_02|javax.enterprise|_ThreadID=10;|Error loading Jdbc Resource:jdbc/aarre. skipping...|#]
    [#|2006-05-06T19:12:55.031+0300|WARNING|sun-appserver-pe8.1_02|javax.enterprise.system.core|_ThreadID=10;|Exception occurred while satisfying optional package dependencies : {0}
    java.lang.NullPointerException
         at com.sun.enterprise.deployment.backend.OptionalPkgDependency.satisfyOptionalPackageDependencies(OptionalPkgDependency.java:183)
         at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:270)
         at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:591)
         at com.sun.enterprise.server.ApplicationServer.onInitialization(ApplicationServer.java:237)
         at com.sun.enterprise.server.PEMain.run(PEMain.java:284)
         at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
    |#]

    Hi,
    I'm experiencing the same problem.
    Did you solve the problem and if yes how ?
    Thanks,
    EDH

  • Infinite loop - A stale JDBC connection was detected in the connection pool

    Hello.
    I have a simple JSP (no servlets) application with a single Fastlane Reader style view object to back it up. I'm deploying my application under OC4J 10g 9.0.4 using BC4J 9.0.3.11.50 (JDev 9.0.3.3) on RHEL 3.0, j2sdk1.4.2_03.
    I run with -Djbo.debugoutput=console
    Every so often, intermittently, and totally unpredictably, I see this on stdout for OC4J:
    03/12/23 07:42:07 [33326] A stale JDBC connection was detected in the connection pool
    03/12/23 07:42:07 [33327] Creating a new pool resource
    03/12/23 07:42:07 [33328] Trying connection/2: url='jdbc:oracle:thin:@somedb:1521:somedbsid' info='{user=someuser, password=somepass, dll=ocijdbc9, protocol=thin}' ...
    This message occurs over and over ultimately resulting in hundreds upon thousands of failed connections to the database. I have to forcibly restart OC4J to stop it.
    The weird thing about it is that it seems to only start doing this on one system (which is our internal deployment site); it works fine under an OC4J running in IDE or on a preproduction machine.
    Has anyone experienced this before - or at the very least, can clue me in on getting BC4J to be a little more verbose on the connection failure?
    Thanks and Happy Holidays,
    Sean

    Hi did you find an answer?
    if so, could you post it here?
    thanks

  • Help in creating the connection pool  for Oracle 8i using Jdriver

    Hi
    Iam pretty new to Weblogic and would be greatfull if some one can help me
    out in finding the parameters to be specified in Weblogic console for creating
    a Connection pool for Oracle 8i database running on solaris. I have installed
    necessary client libraries in weblogic machine.
    The details for my database are as follows
    database name : mydb
    database server : 173.24.24.1
    database port : 1521
    username : myuser
    I would appreciate if you can provide me the following details to be entered in
    weblogic console for creating the connection pool
    URL
    DRIVER CLASS NAME
    PROPERTIES
    ACL NAME
    PASSWORD
    Thanks,
    S Hari

    Hari
    Jdbc Connection Pool Configuration
    URL= jdbc:weblogic:oracle
    DRIVER CLASS NAME=weblogic.jdbc.oci.Driver
    PROPERTIES
    user=myuser
    password=<password in mydb>
    server=mydb
    After configuring Connection Pool Select Targets tab. Select Server from Available
    to Chosen.
    Deepak
    Hari wrote:
    Hi
    Iam pretty new to Weblogic and would be greatfull if some one can help me
    out in finding the parameters to be specified in Weblogic console for creating
    a Connection pool for Oracle 8i database running on solaris. I have installed
    necessary client libraries in weblogic machine.
    The details for my database are as follows
    database name : mydb
    database server : 173.24.24.1
    database port : 1521
    username : myuser
    I would appreciate if you can provide me the following details to be entered in
    weblogic console for creating the connection pool
    URL
    DRIVER CLASS NAME
    PROPERTIES
    ACL NAME
    PASSWORD
    Thanks,
    S Hari

  • How to Troubleshoot the Connection Pool Exception?

    Dear Oracle Gurus, very good afternoon to you.
    I'm looking forward for some tips/troubleshoting guide to escape from the below exception, that occres very frequently to one of application that 100+ users will login from different locations & work on and update the data and save their work, where all in sudden they can't acces the application and it gets down.
    Most of the times in the server log I observed below.
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    Please help me on, how to overcome this kind of exception.
    In Weblogi c server I see below kind of Warnings.
    If you set the buffer size to zero in a servlet, it would fail to respond and would initiate an infinite loop in the server. WebLogic Server would ultimately display a Errors:
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    I searched over google for this kind of error, See otherusers posted the same kind of errors but didn't have any positive replies to troubleshoot this issue.
    I also got Oracle Dev link on Weblogic version upgrade product where they fixed similar kind of error it seems. Which is shown below.
    http://docs.oracle.com/cd/E13222_01/wls/docs61/notes/bugfixes2.html -- BUG # CR106186
    details:
    "Suspend Checker Thread" prio=10 tid=0x23eb90 nid=0xfec runnable
    <May 14, 2003 10:53:34 AM PDT> <Warning> <WebLogicServer> <000337>
    <ExecuteThread: '10' for queue: 'default' has been busy for "1,181" seconds working on the request "Http Request: servlet_uri", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.>
    This problem was solved with a code fix.
    Looking forward for some help, Thank you inadvance.
    FYI..
    I'm using oracle thin driver JDBC connection/Weblogic 8.1
    Edited by: user1072948 on Apr 26, 2012 11:55 AM

    I agree that looking into the number of connections that you have open when you see
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    would be a good idea; but I would suggest that you don't increase without thinking about the consequences. I would look more closely at what the connections to the database are doing, for instance, how long are the connection being left open for? What are the queries that are being run? Should you expect to see all the connections in the connection pool being used? What is the current connection pool limit? Are you simply going to increase the number of connections to find that they are also waiting? What is the load on the database at the time?
    It's the other error that you say you see
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    What does this JSP do? Why would this be busy for so long? Is it related to the previous exception that you have? I'd ask you delevelopment team to look into this.
    In short, it sounds like you have load issues on your server(s) and a careful tuning of the system after a full analysis (thread dumps, heap profiling, connection pool monitoring and code review) would probably be beneficial. It may be that restricting the thread pool may help, it may be that increasing the connection pool would help. I'd not plump for a quick fix here.

  • Regarding the connection pool Error

    Hi All,
    I am using weblogic10.3. While starting the server we are able to see the below exceptions in the logs which was causing the server to failed state ,even we resume the
    server,the server will come to running state but the instance will not be there in the connection pool monitoring tab .once we restart the server again,its working.
    can you please let me know why we are getting these errors and any help to remove these.
    ####<Apr 14, 2010 6:29:29 AM CDT> <Error> <Server-name> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS
    Kernel>> <> <> <1271244569352> <BEA-149205> <Failed to initialize the application 'dsname' due to error weblogic.application.ModuleException: .
    weblogic.application.ModuleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:289)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
    at weblogic.deploy.internal.targetserver.SystemResourceDeployment.prepare(SystemResourceDeployment.java:55)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
    at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
    at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: Io exception: The Network Adapter
    could not establish the connection
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:253)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
    at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214)
    at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
    at weblogic.jdbc.common.internal.ConnectionPool.start(ConnectionPool.java:146)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:385)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:326)
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:251)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
    at weblogic.deploy.internal.targetserver.SystemResourceDeployment.prepare(SystemResourceDeployment.java:55)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
    at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
    at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Hi,
    Looks like the Database URL may not be correct or may be the TNS name OR some n/w issue between WLS BOX and the DB Box. Please try the following to Double Check it.
    <font color=red><b>Test Number-1</b></font><BR>
    <font color=maroon><b>Step1).</b></font> Add JDBC Driver also in the Classpath or Better run *"setWLSEnv.sh"*
    <font color=maroon><b>Step2).</b></font> Use WLS DB Ping utility:
    Syntax:
    java -classpath /bea103/wl_server103/server/lib/weblogic.jar utils.dbping ORACLE_THIN <dbUserName> <dbPasswoes> <dbURL>
    Example:
    java -classpath /bea103/wl_server103/server/lib/weblogic.jar utils.dbping ORACLE_THIN scott tiger databaseHostName:1521:P15215h
    <font color=red><b>Test Number-2</b></font>
    Please run the Following Program from your WLS Server Box:
    import java.sql.*;
    public class TestConnection
    public static void main(String ar[]) throws Exception
    System.out.println("\n\t Database URL: "+ar[0]);
    System.out.println("\n\t Database UserName: "+ar[1]);
    System.out.println("\n\t Database Password: "+ar[2]);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("\n\t Driver Class Registered and Loaded Successfully...");
    System.out.println("\n\n\n\t Trying to Connect to Database....");
    Connection con=DriverManager.getConnection(ar[0],ar[1],ar[2]);
    System.out.println("\n\n\n\t CONNECTED TO DATABASE SUCCESSFULLY");
    To RUN:
    java -classpath /opt/app/yourOracelDriverLocation/ojdbc6.jar:.: TestConnection oracelJdbcURL Oracleusername Oraclepassword
    if above fails to connect to DataBase ...it simply means Connectivity issue with your database friom the WebLogic Box.
    Thanks
    Jay SenSharma

  • How can I switch the connection pool dynamically during on load happens

    HI,
    I have two data bases which holds same data. i.e Prod_db, Prod_db1,
    I want to switch the connection pool dynamically during load happens
    Ex: During load happens i want to hit prod_db1, after load completes i want to hit prod_db. How to achieve this.

    create dynamic repository variable for DSN using init block so that value is changes based on your timings and use this in connection pool.
    If you use same user and passwords for both the databases that would be easy or else need to follow the same for uid and pwd.
    That should work, if not update.
    If helps pls mark correct/helpful

  • How to change the connection pool configuration on OC4J?

    Hi everybody,
    I am developing an application with JDeveloper which is running on an OC4J standalone server, we have 2 enviroments, the develop server and the server of the client, and the data base connection configurations are differents.
    The problem is that if we try to deploy the application (we have deploy on the develop server) on the client server and try to change the connection pool configuration the application cannot connect to the data base, we need to re-build the project with the client connection pool configuration.
    We tried to change the configuration on the enterprise manager of the OC4J, on "JDBC Resources" panel, and the test the connection is ok, but when try to access to the application we get an Exception. After that we try to do that changing the parameters from the datasources.xml file on the application, but the result is the same.
    How can we change the DataBase configuration without re-build the project?
    Thanks very much
    Tony

    Meaning you have created just the empty data-sources.xml and not configured any Connection Pool and DataSource in JDev?
    In Oracle AS 10.1.3 you have two ways to do this:
    1. Use JDev and configure the data-sources.xml (Context Menu -> Properties)
    2. In Oracle AS: Select application -> Administration -> Services -> JDBC Resources -> Create Pool and Create DataSource
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • WLS 5.1 with SP11 and Sybase connection pools

    I had posted back in January about an issue with WLS 6.1 and Sybase connection
    pools (see posts 12040 - 12043). This issue has now appeared in WLS 5.1 with
    SP 11. I have backed out SP11, but I'd take advantage of the clustering enhancements
    in this SP. Any suggestions? Would it be possible to get another one off patch
    for SP11?

    Could you fill me in as to what problem you were having. We are also using
    Sybase with WLS5.1 and experience intermittent truncating of resultsets.
    Regards,
    Garvin LeClaire
    [email protected]
    "Pete Auriemma" <[email protected]> wrote in message
    news:3c8669ee$[email protected]..
    >
    I had posted back in January about an issue with WLS 6.1 and Sybaseconnection
    pools (see posts 12040 - 12043). This issue has now appeared in WLS 5.1with
    SP 11. I have backed out SP11, but I'd take advantage of the clusteringenhancements
    in this SP. Any suggestions? Would it be possible to get another one offpatch
    for SP11?

  • HT4623 THE SCREEN ON MY IPOD TOUCH SHOWS THE iTUNES SYMBOL AND THE CONNECTION CORD. IT WILL NOT DO ANYTHING IT IS FROZEN LIKE THAT. WHAT TO DO?

    The screen on my ipod touch is frozen with the iTunes symbol and the connection cord. I don't know how to get past this. Has been like this for over a week. Need help PLEASE.

    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • How to track the connection pool refresh details

    Hi,
    Could you please help to track the connection pool refresh details.
    Thanks
    Panneer

    Hi,
    I want track connection pool refresh details for oracle application server 10.1.3.4.
    Please help me to get this info.
    Thanks
    Panneer

  • I was updating my phone and and the connect to itunes sign has come on and wont go? now my phone is wont come on and if i try the same connect to itunes sign comes up

    i was updating my phone and and the connect to itunes sign has come on and wont go? now my phone is wont come on and if i try the same connect to itunes sign comes up

    You need to restore the device to factory settings using a computer with iTunes.  Then, if you have a backup, you can try restoring the backup to your device.

Maybe you are looking for