Not able to work with multiple Databases using  oracle.jdbc.driver.OracleDr

Hi all,
I am using the following Oracle Driver in Weblogic 6.1 sp 4
oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
Driver. I am not able to select rows from two different table, which resides in two different Databases.
The Exception is :
SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
nother pool: MultiTransactionTest
Start server side stack trace:
java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
on from another pool: MultiTransactionTest
at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
Can any one help me to fix this issue?
-Thanks & Regards,
Shamil.S

Shamil S wrote:
Hi all,
I am using the following Oracle Driver in Weblogic 6.1 sp 4
oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
Driver. I am not able to select rows from two different table, which resides in two different Databases.
The Exception is :
SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
nother pool: MultiTransactionTestHi. You can't domultiple DBMSes in one transaction unless you use an XA driver and
an XA transaction. Your workarounds are:
1 - Use an XA driver, datasource, and tx
2 - If you're just reading, you can use non-transactional datasources. Do make sure you
always close your connections...
Joe
>
Start server side stack trace:
java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
on from another pool: MultiTransactionTest
at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace
Can any one help me to fix this issue?
-Thanks & Regards,
Shamil.S

Similar Messages

  • Problem in connecting to database using oracle jdbc thin driver

    hi
    i am trying to connect to a database using oracle thin driver.
    i am getting following error:
    java.sql.sqlexception:Io exception: the network adapter could not establish the connection
    Io exception: the network adapter could not establish the connection
    the connection string has the property of using a dedicated server
    for this reason i have put USE_DEDICATED_SERVER=ON in sqlnet.ora file...
    we did not face this problem while connecting to other databases which do not have the property of dedicated server in their connection string in tnsnames.ora file.
    please suggest a solution for this.
    thanks and regards,
    asif

    If you are using the thin driver, sqlnet.ora does not come into play. None of Oracle networking does. That is one of the great things about using the thin driver, no need to have the client installed.
    That error is due to incorrect connection info you are supplying or the machine you are connection from can't ping the machine it is trying to connect to.

  • Not able to connect to database using Oracle ODBC Driver

    Hi,
    I have installed Oracle client on a system. there are 2 homes installed. When I check the ODBC administrator, I see that only one ODBC driver is present. There are Net 8 services configured in both the homes.
    When I try to connect to a database with the services configured in the second home using the ODBC driver, I am getting an error that the TNS name could not be resolved.
    How can I use the ODBC driver to connect to the databases using services defined in the second home?
    The name of the ODBC driver is 'Oracle in <firsthomename>
    Thanks & Regards

    Hi,
    Thanks for the help.
    I tried this, but it doesn't work. I'm still getting the error.
    Now I am not able to create a DSN when I set the ORACLE_PATH to the second home. It says 'the setup routines for the Oracle in ora1 ODBC Driver could not be loaded due to system error code 998.'
    Any other solution?
    Thanks in advance & Regards
    Anuja

  • Not able to register with listener after installing oracle grid infrastrtcure in oracle 11gr2 on windows

    Hi Guru's.
    I am not able to get listener connectivity after installing Oracle 11gr2 Grid infrastructure on windows on vmware workstation. I register with static ip.
    Even i recreated the listener and running the listener from Grid home.
    The output what i am getting is :--
    C:\> lsnrctl status
    The listener support no services
    Can you please help me out

    C:\Users\Administrator>lsnrctl stop
    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 26-NOV-2013 09:09:10
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    The command completed successfully
    C:\Users\Administrator>lsnrctl start
    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 26-NOV-2013 09:09:21
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Starting tnslsnr: please wait...
    TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
    Log messages written to c:\app\administrator\diag\tnslsnr\WIN-0P8BCA3R7V5\listener\alert\log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-0P8BCA3R7V5)(PORT=1521)))
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
    Start Date                26-NOV-2013 09:09:24
    Uptime                    0 days 0 hr. 0 min. 4 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         c:\app\administrator\diag\tnslsnr\WIN-0P8BCA3R7V5\listener\alert\log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-0P8BCA3R7V5)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    C:\Users\Administrator>lsnrctl status
    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 26-NOV-2013 09:09:31
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
    Start Date                26-NOV-2013 09:09:24
    Uptime                    0 days 0 hr. 0 min. 8 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         c:\app\administrator\diag\tnslsnr\WIN-0P8BCA3R7V5\listener\alert\log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-0P8BCA3R7V5)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    C:\Users\Administrator>lsnrctl service
    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 26-NOV-2013 09:13:10
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    Services Summary...
    Service "+asm" has 1 instance(s).
      Instance "+asm", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "orcl" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1022 state:ready
             DISPATCHER <machine: WIN-0P8BCA3R7V5, pid: 2560>
             (ADDRESS=(PROTOCOL=tcp)(HOST=WIN-0P8BCA3R7V5)(PORT=49246))
    The command completed successfully

  • Sql_trace does not work for Java app using Oracle JDBC thin driver

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

  • Problem using Oracle JDBC Driver

    Hi,
    I try to configure the Oracle JDBC Driver the following way:
    I load the Oracle drivers ojdbc14_g.jar and nls_charset12.jar
    I configure the DataSource using the Driver Class oracle.jdbc.driver.OracleDriver, the database URL: jdbc:oracle:thin:@h50a430:1521:WLP1E1A0 and the User with Password.
    As soon as its activated I get the following error:
    java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Complex error : server ID 4123350:Cannot start DataSource "Oracle".
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:678)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:660)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:535)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    any hint?

    I can't create an Oracle datasource too.
    Uploaded ojdbc14.jar, used the same Oracle jdbc settings as in my jdbc explorer where everything works fine, set initial connections to 1, set SQL Engine to Native SQL,...
    -> won't start.
    I restarted the cluster too. The Datasource is still marked with a red cross in the admin tool.
    This is with the type 1.x setting, as XA seems to be still broken in WAS 6.40.

  • How to use Oracle jdbc driver fixedString property?

    Oracle pads values in char columns so if I insert "a" in a CHAR(2) column then I cannot get that record by comparing that column to "a", I should get it by comparing it to "a ". Right?
    To solve this problem the Oracle jdbc driver has the property fixedString but I cannot make it work. (look for fixedString here )
    I'm using ojdbc14.jar driver for Oracle 10gR2 and accessing an Oracle 10gR2 database.
    This is my code:
    try {
    Properties props = new Properties();
    props.put("user", "****");
    props.put("password", "****");
    props.put("fixedString", true);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String jdbcUrl = "jdbc:oracle:thin:@<host>:<port>:<sid>";
    Connection connection = DriverManager.getConnection(jdbcUrl, props);
    PreparedStatement ps = connection.prepareStatement(
    "SELECT * FROM MY_TABLE WHERE MY_TABLE_ID = ?");
    ps.setObject(1, "abc"); // (*)
    // MY_TABLE_ID is CHAR(15)
    ResultSet rs = ps.executeQuery();
    while (rs.next())
    System.out.print("data: ");
    System.out.println(rs.getString("MY_TABLE_ID"));
    rs.close();
    ps.close();
    connection.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
    ex.printStackTrace();
    The above code executes fine (no exceptions thrown) but the ResultSet is empty after executeQuery().
    If I change the line (*) for
    ps.setObject(1, "abc ");
    Then I get the column I wanted. So it seems the driver is ignoring the fixedString option.
    I've also tried changing the line (*) for
    ps.setObject(1, "abc", java.sql.Types.CHAR);
    But the ResultSet I get is empty again. What am I missing?
    Thanks in advance

    Es un Bug se corrige en la versión del OAS 10.1.2.3
    Bug 10222534: UNABLE TO SET FIXEDSTRING PROPERTY IN DATASOURCE

  • How to use Oracle jdbc driver fixedString property in datasource.xml?

    I try configured fixedString property in the datasource.xml but doesnt work, this is in oc4j
    <data-source location="jdbc/prueba" class="com.evermind.sql.DriverManagerDataSource"
    password="xxxxx"
    max-connect-attempts="3"
    xa-location="jdbc/xa/prueba"
    ejb-location="jdbc/prueba"
    wait-timeout="1800"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="xxxx" min-connections="35"
    max-connections="300"
    url="jdbc:oracle:thin:@144.1.0.54:1521:nodox"
    inactivity-timeout="300" name="jdbc/prueba">
    <property name="fixedString" value="true"/>
    </data-source>
    i Solved this problem in tomcat:
    <Resource name="jdbc/testsql" auth="Container"
    type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@144.1.0.54:1521:nodox"
    username="xxxxx" password="xxxxxxxx"
    maxActive="8" maxIdle="4" connectionProperties="fixedString=true;"/>

    Es un Bug se corrige en la versión del OAS 10.1.2.3
    Bug 10222534: UNABLE TO SET FIXEDSTRING PROPERTY IN DATASOURCE

  • Not able to work with customized Java roles which were edited in ABAP stack

    Hello All,
    I am trying to copy standard roles into customized roles (i.e. Z roles) using PFCG in XI system. All ABAP based roles are working fine, but all JAVA based roles are not working. I generated profiles as well. And I check all the authorization objects in both standard and customized roles. Everything look same but customized roles are not working.
    And when I check the logs on JAVA stack I found the error which says " User XXXXXXXXXX IP address HTTP request processing failed. HTTP error [403] will be returned. The error is [You are not authorized to view the requested resource.No details available]."
    I thought there might be any Jco RFC connections missing between the stacks and I tried to check in Visual Admin, but I was not able to find much info regarding these roles.
    Am I missing anything or is there any other way for these roles to make customized roles.
    And can any one tell me how to run a trace for JAVA stack activitites as we do in ABAP using ST01. Any help will be rewarded. Thanks in advance.
    Regards,
    Farooq.

    Java roles work with influence of permissions in Application Server which we call actions in UME. As you are aware in PI user master record will be in ABAP stack. So the roles in ABAP stack will be having only RFC connections to JAVA stack for the specific JAVA based role. So you need to edit the permission on Java App Server. For that you need to log on to server through visual admin and then go to services and you will find the standard groups assigned to actions. But I don’t remember that under which service you will find them
    Under that service you will find some 200 actions. And you have to add the name of the custom created JAVA roles on ABAP to all those actions where you find the standard roles. And its a very very lengthy procedure. So SAP advice to go for customized ABAP roles and Standard JAVA roles.
    Hope this answer clears your query.
    Farooq.

  • Working with multiple databases

    Suppose I have a large project that follows the formal "SDLC" model for software development; it has various stages, environments, development, integration testing, system testing, UAT, etc. Each of these environments is on its own dedicated Oracle database.
    An query-only Apex application is built as a testing aid for the various environments to quickly see reports, test data conditions, etc. This application is deployed to all the environments.
    With other web development technologies (PHP, ASP/.NET, etc) which live outside Oracle and access Oracle using a userid/connect string. If some aspect of the application needs to be changed, it is done in 1 place (the application) and the new/modified functionality is available for use against all the enviroments (just change the connect string in the URL or some config file to access different environments).
    With Apex, the change to the application has to be done in all the 4 environments. This seems like a case where the Apex architecture (all app metadata in Oracle) is a disadvantage.
    Comments? Thanks

    That would be that case if you are only talking about only moving through the SDLC with your database changes yes? In many cases, you make changes both to the underlying database structure/code and the application (PHP, ASP, etc) so your application would "follow" your database code wouldn't it?
    chet
    *Disclaimer:  I have not worked in such an environment in about 2 years, so I'm a bit rusty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Not able to login into the database on oracle 10g on vista os

    Hi,
    I have install oracle 10g on vista machine.
    I am not able to log in to the database ia have tryied with scott/tiger, system/manager, sys/changeoninstall.
    can anyone please tell me what the default username password to 10g version for vista machine.
    Oracle version 10g
    OS: Vista
    Thanks
    Amit

    sqlplus / as sysdba
    or
    sqlplus /nolog
    conn / as sysdba
    or
    sqlplus '/ as sysdba'

  • Dashland plug in does not seem to work with my mac using version 33.1

    I've followed instructions on uninstalling and then reinstalling the dashland plug in of my Mac using version 33.1. I just upgraded to 33.1 and Dashland is not working at all. Is there a workaround? Could I use the older version 33.0 until there is a bug fix with Dashland?

    Several users have reported an issue with Dashlane according to comments on their Facebook page (note I do not use this software myself). However, this does not appear to be a Firefox issue, so you should contact Dashlane to see how you can get this problem resolved:
    * http://support.dashlane.com/
    * http://support.dashlane.com/customer/portal/emails/new

  • Not able to connect with managed server using ssl connection

    Hi Guys,
    My weblogic server is running on linux. I have setup ssl connction bu using Demo Identity and Demo Trust.In server logs i can find the following infomation that server is running on secure port.
    But once i try connect to managed server using client i m facing below error:
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090908> <Using default WebLogic SSL Hostname Verifier implementation.>
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3s://host:port: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:767)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
         at weblogic.jndi.Environment.getContext(Environment.java:315)
         at weblogic.jndi.Environment.getContext(Environment.java:285)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
         at javax.naming.InitialContext.init(InitialContext.java:242)
         at javax.naming.InitialContext.<init>(InitialContext.java:216)
         at com.akt.client.WLCLIENT.makeConnection(WLCLIENT.java:40)
         at com.akt.client.WLCLIENT.main(WLCLIENT.java:60)
    Caused by: java.net.ConnectException: t3s://host:port: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:165)
         at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
         ... 9 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:470)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:321)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:260)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
         at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
         ... 15 more
    But in server logs i can see below message
    opt/Oracle/Middleware/wlserver_12.1/server/lib/DemoIdentity.jks.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /opt/Oracle/Middleware/wlserver_12.1/server/lib/DemoTrust.jks.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /opt/jdk1.7.0_21/jre/lib/security/cacerts.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on hostname:port for protocols iiops, t3s, ldaps, https.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <WebLogicServer> <BEA-000332> <Started the WebLogic Server Managed Server "Server-Test" for domain "base_domain" running in development mode.>
    Please suggest
    Edited by: 1008140 on May 27, 2013 2:37 AM

    Welcome to OTN
    This section related to Database question not fusion middle ware Post your question
    Oracle Discussion Forums » Fusion Middleware

  • Not able to work with Class.forName

    I am trying to use Class.forName() from a string which is passed to me as argument.
    Class batchClass = Class.forName(args[1]);
    A jar file contains the class file for the string received above and I have this jar file in the manifest of my executable jar.
    I get a class not found exception when I run my executable jar
    Can some body give pointers..what could possibly be the issue.
    The jar file is in my classpath
    Message was edited by:
    chabhi

    run script
    #!/bin/csh
    java -jar -DDBPROVIDER=NO -DDBUS_ROOT=$DBUS_ROOT -DVTNAME=$VTNAME ./jar/IntraDayDepotPositionBatch.jar MagellanStart IntraDayDepotPositionBatch INPUTFILE LOGFILE
    Exception
    Magellan program starting - program class IntraDayDepotPositionBatch
    Cannot find program class - IntraDayDepotPositionBatch
    IntraDayDepotPositionBatch
    java.lang.ClassNotFoundException: IntraDayDepotPositionBatch
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at com.db.mmrepo.app.IntraDayDepotPositionBatch.MagellanStart.main(Unknown Source)
    THanks for your time on this issue,,,,

  • Escape characters using Oracle JDBC

    We use Oracle JDBC driver to do some operations on an Oracle 9i database, and ran into some problems with escape characters. Basically we'd like to escape the _ and % characters.
    The following two example statements both work:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' escape '\\' ");
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' {escape '\\' }");
    However, when we have multiple query terms and the "escape" clause doesn't immediately follows EACH "like" clause, we got errors saying the sql statement does not end properly. One such example is the following:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' and creator = 'ABC' {escape '\\'} ");
    If we put an "escape" clause following each "like" clause, then it works.
    My question is, is there a smart way of letting JDBC knows that you want to use an escape character everywhere in the query? We often do very complicated dynamic queries, frequently with table joins and boolean logic and subqueries with tons of query terms. Trying to add the escape clause to each "like" clause is very painful. Any help is highly appreciated. Thanks!
    BL

    I'd use PreparedStatements, if you're not already. Let the JDBC driver escape things properly for you. That's what the setString() and setDate() methods are all about.

Maybe you are looking for