JDBC re-connection to oracle

I have an application using connection pooling. When the oracle
server it is connected to is rebooted/shut down, the connections
are of course broken. I can detect this fine but when I try to
re-connect to the database with
Connection connection = DriverManager.getConnection(url,
username, password);
the whole program just hangs on that. Seems to me that the JDBC
driver never returns from the call. Is there some timeout I can
set or something else I can do to make it return when the
connection fails? The same code works for other databases and
drivers.
If I try to make a connection to the oracle when I start the
app and no connection has previously been made, the driver
returns correctly saying, no connection or something like that.
I am using oracle 8i with the 1.2 thin drivers (classes12.zip).
Thanks for any help..

I have an application using connection pooling. When the oracle
server it is connected to is rebooted/shut down, the connections
are of course broken. I can detect this fine but when I try to
re-connect to the database with
Connection connection = DriverManager.getConnection(url,
username, password);
the whole program just hangs on that. Seems to me that the JDBC
driver never returns from the call. Is there some timeout I can
set or something else I can do to make it return when the
connection fails? The same code works for other databases and
drivers.
If I try to make a connection to the oracle when I start the
app and no connection has previously been made, the driver
returns correctly saying, no connection or something like that.
I am using oracle 8i with the 1.2 thin drivers (classes12.zip).
Thanks for any help..

Similar Messages

  • JDBC SSL connection to Oracle

    Hi All,
    I have been trying to connect to Oracle using a self signed certificate from a simple Java class. I am getting the below error.
    main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    main, SEND TLSv1 ALERT: fatal, description = handshake_failure
    I have searched many forums but couldnt find the information of my help.
    Below are the steps I have followed as per the documentation in wp-oracle-jdbc-thin-ssl-130128.pdf.
    First Step: Created a self signed certificate and a truststore with the below commands using JDK 1.6.0_16
    Create a Keystore:
    keytool -genkey -keyalg RSA -alias MyKey -keystore keystore.jks -validity 360
    Extracting the public key:
    keytool -export -rfc -alias MyKey -keystore keystore.jks -file public.cert
    Creating the Truststore:
    keytool -import -alias MyKey -file public.cert -storetype JKS -keystore keystore.truststore
    Second Step: Added the following in listener.ora and sqlnet.ora
    listerner.ora :
    # listener.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = D:\oracle\product\11.2.0\dbhome_1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    SSL_CLIENT_AUTHENTICATION = FALSE
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = localhost)(PORT = 2484))
    ADR_BASE_LISTENER = D:\oracle
    WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    sqlnet.ora :
    # sqlnet.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    ENCRYPTION_WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    SSL_CLIENT_AUTHENTICATION = FALSE
    WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    ADR_BASE = D:\oracle\product\11.2.0\dbhome_1\log
    Third Step: Created an empty auto logon wallet and added the above created certificate as a Trusted Certificate. (Imported the .cert file into the Trusted Certificates section in Wallet Manager)
    Fourth Step: Used the below Java code to connect to the database using the truststore
    public static void main(String[] args) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))"; Properties props = new Properties(); props.setProperty("user", "system"); props.setProperty("password", "oracle"); props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore"); props.setProperty("javax.net.ssl.trustStoreType","JKS"); props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#"); Connection conn=DriverManager.getConnection(url,props); System.out.println("conn:"+conn); conn.close(); } catch(Exception e) { e.printStackTrace(); } }
    Any help would be appreciated.
    Thanks.
    Edited by: user10569290 on 20-Feb-2013 22:02

    Hi EJP,
    Please find the below code changes I have done to set the properties as part of System properties instead of Connection properties. I am still getting the same error.
    Code:
    Class.forName("oracle.jdbc.driver.OracleDriver");
              String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))";
              Properties systemProps = System.getProperties();
              systemProps.put("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
              systemProps.put("javax.net.ssl.trustStoreType","JKS");
              systemProps.put("javax.net.ssl.trustStorePassword","sudhir123#");
              System.setProperties(systemProps);
              Properties props = new Properties();
              props.setProperty("user", "system");
              props.setProperty("password", "oracle");
              /*props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
              props.setProperty("javax.net.ssl.trustStoreType","JKS");
              props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#");
              Connection conn=DriverManager.getConnection(url,props);
             System.out.println("conn:"+conn);
             conn.close();Please find the below output with the SSL debug enabled.
    adding as trusted cert:
    Subject: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
    Issuer: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
    Algorithm: RSA; Serial number: 0x511e1ebc
    Valid from Fri Feb 15 17:10:44 GMT+05:30 2013 until Mon Feb 10 17:10:44 GMT+05:30 2014
    trigger seeding of SecureRandom
    done seeding SecureRandom
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1361369602 bytes = { 14, 223, 155, 241, 143, 72, 188, 240, 205, 158, 201, 133, 217, 192, 95, 82, 61, 244, 93, 100, 12, 9, 232, 164, 116, 206, 30, 142 }
    Session ID: {}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    main, WRITE: TLSv1 Handshake, length = 73
    main, WRITE: SSLv2 client hello message, length = 98
    main, received EOFException: error
    main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    main, SEND TLSv1 ALERT: fatal, description = handshake_failure
    main, WRITE: TLSv1 Alert, length = 2
    main, called closeSocket()
    main, called close()
    main, called closeInternal(true)
    java.sql.SQLRecoverableException: IO Error: Remote host closed connection during handshake
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:466)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:535)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:218)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
         at java.sql.DriverManager.getConnection(DriverManager.java:582)
         at java.sql.DriverManager.getConnection(DriverManager.java:154)
         at SecureJDBC.getSecureConnection(SecureJDBC.java:52)
         at SecureJDBC.main(SecureJDBC.java:15)
    Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
         at oracle.net.ns.Packet.send(Packet.java:421)
         at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:170)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:302)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1407)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
         ... 8 more
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
         at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
         ... 16 more

  • Error while creating a JDBC connection to Oracle 11g using WLS 6.1

    Hi
    I am trying to connect to Oracle 11g database on Weblogic 6.1 server.
    First of all i would like to know if this is compatible?
    The environement that i have is this
    1. JDK 1.3
    2. Database 11g is on remote system
    3. Oracle client on my local system ( Connecting to the 11g DB through the client works fine)
    4. Weblogic server 6.1
    5. Currently the application is connected to Oracle 10g DB and working fine(We are attempting to move it to 11g)
    Below are the steps that i followed to create the connection:
    1. Made an entry for the datasource in config.xml under <WLS_DOMAIN>/config folder as below
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    MaxCapacity="4" Name="CADConnectionPool"
    Properties="user=abc_proxy;password=proxy_abc;dll=ocijdbc8;protocol=thin"
    RefreshMinutes="5" ShrinkPeriodMinutes="10" Targets="CAsvr"
    TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    TestTableName="dual" URL="jdbc:oracle:thin:@gen11t-ora.db.lab.xyz.com:1530:GEN11T"/>
    2. Restarted the server.
    3. Ran the application and get the following error on the server console:
    <Aug 22, 2011 12:39:42 AM CDT> <Error> <JDBC> <Cannot startup connection pool "C
    ADConnectionPool" weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.lang.ArrayIndexOutOfBoundsException
    at oracle.security.o3logon.C0.r(C0)
    at oracle.security.o3logon.C0.l(C0)
    at oracle.security.o3logon.C1.c(C1)
    at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
    elper)
    at oracle.jdbc.ttc7.O3log.<init>(O3log.java:289)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:193)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:705)
    at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:650)
    at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:360)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:285)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:239)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:199)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy31.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2977)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:372)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy42.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:480)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
    at weblogic.management.Admin.finish(Admin.java:644)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
    at weblogic.Server.main(Server.java:35)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:209)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:705)
    at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:650)
    at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:360)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:285)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:239)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:199)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy31.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2977)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:372)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy42.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:480)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
    at weblogic.management.Admin.finish(Admin.java:644)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
    at weblogic.Server.main(Server.java:35)
    Can't load scjd12.dll, file not found java.library.path=C:\jdk1.3.1_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;.\bin;C:\P
    rogram Files\Lotus\Notes\Data;C:\Program Files\Lotus\Notes;C:\Program Files\Java
    \jre1.5.0_17\bin;C:\Program Files\Java\j2re1.4.2_06\bin;C:\Oracle\bin;C:\Program
    Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\sys
    tem32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\nls;C:\WINDOWS\sys
    tem32\nls\ENGLISH;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Rational
    \common;C:\Program Files\Rational\ClearCase\bin;C:\apache-ant-1.6.5\bin;C:\jdk1.
    3.1_11\bin;C:\Program Files\Citrix\ICAService\;C:\Program Files\Citrix\System32\
    ;Z:.
    <Aug 22, 2011 12:38:06 AM CDT> <Info> <JDBC> <Sleeping in createResource()>
    <Aug 22, 2011 12:38:07 AM CDT> <Error> <JDBC> <Cannot startup connection pool "c
    ispool" weblogic.common.ResourceException:
    Could not load 'com.neon.jdbc.Driver
    If this is a type-4 JDBC driver, it could occur if the JDBC
    driver is not in the system CLASSPATH.
    If this is a type-2 JDBC driver, it may also indicate that
    the Driver native layers(DBMS client lib or driver DLL)
    have not been installed properly on your system
    or in your PATH environment variable.
    This is most likely caused by one of the following:
    1. The native layer SO, SL, or DLL could not be found.
    2. The file permissions on the native layer SO, SL, or DLL
    have not been set properly.
    3. The native layer SO, SL, or DLL exists, but is either
    invalid or corrupted.
    For more information, read the installation documentation
    for your JDBC Driver, available from:
    http://e-docs.bea.com
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:212)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:705)
    at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:650)
    at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:360)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:285)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:239)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:199)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy31.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2977)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:372)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:360)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    57)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    25)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy42.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:480)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
    at weblogic.management.Admin.finish(Admin.java:644)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
    at weblogic.Server.main(Server.java:35)
    Would like some help on this asap as the project is in critical stage.
    Thanks

    The driver being used by your weblogic is too old and incompatible with the DBMS. Upgrade the driver.

  • How do I connect to Oracle with JDBC using "dedicated processor".

    Because of performance problems we want to try to connect to
    oracle using dedicated processor. We can do this from SQL Plus,
    does anybody know what we need to set up in order to utilize
    this from JDBC?

    Which Java runtime error? (stack trace?)

  • JDBC connection to Oracle 10g RAC periodically times out

    I've been banging my head against the wall for months now and can't figure out why this is and what's causing it.
    We have 6x CF8 servers in our environment. 3 of which work perfectly and the other 3 have the following problem. All 6 machines were installed at the same time and followed the exact same installation plan.
    When I configure Oracle RAC data source, some of the machines time-out connecting to Oracle from time-to-time.
    Config:
    Solaris 9 on both CF and Oracle
    CF8 Enterprise with the latest updater.
    Apache 2 (not that it's relevant)
    6 machines, load-balanced (not clustered), identical install and configuration.
    data source config:
    JDBC URL: jdbc:macromedia:oracle://10.0.0.3:1521;serviceName=dbname.ourdomain.com;AlternateServers= (10.0.0.4:1521);LoadBalancing=true
    DRIVER CLASS: macromedia.jdbc.MacromediaDriver
    The problem:
    Every few minutes, CF starts hanging requests that deal with a specific RAC only data source. After about 30 seconds, all requests bail and generate this error in cfserver.log:
    A non-SQL error occurred while requesting a connection from dbsource.
    Timed out trying to establish connection
    This happens with any RAC data source on the "bad" servers while the "good" servers don't have this problem. The "bad" server doesn't have any problems with direct (non-rac) Oracle data source.
    Already tried:
    Moving server connections around on a switch (rulling out bad switch port)
    Copying driver from the healthy server (but it's the same installer anyway)
    Changed from RAC to normal Oracle type data source - works perfectly. So at the moment I have 3 servers connecting to a specific oracle instance and the other 3 connecting to RAC.
    Tried googling and searching forums and even Oracle metalink - nothing I could see relevant to this.
    It's a shame that after spending a ton of money on CF8 upgrades and Oracle RAC, we can't really utilize fail-over on the database connection.
    Any takers?
    Thanks,
    Henry

    I have the following in my CLASSPATH:
    C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\jdbc.jar;
    C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;
    C:\Ora10g1\product\10.2.0\db_1\jlib\jndi.jar;
    C:\Ora10g1\product\10.2.0\db_1\jlib\orai18n.jar;
    Still 'Cannot find type 'oracle.jdbc.pool.OracleDataSource'
    Thanks

  • Need to connect to Oracle 11g using PI 7.1 JDBC adapter

    Hi All,
    I am trying to configure a JDBC adapter to connect Oracle 11g. For this I need to know the driver,jar and connection URL details.
    Can anyone please provide the above information?
    Please correct me if my details are wrong :
    JDBC Driver : oracle.jdbc.driver.OracleDriver
    JAR : ojdbc5.jar
    URL : jdbc:oracle:thin:@localhost:1521:ora11i
    Regards,
    Prakash.

    Yes i knew how to deploy the jars using SDA.
    I will try to deploy the above jar (ojdbc5.jar ) and try to connect to Oracle 11g with URL & Driver classname.
    If I face any problem then i will get  back to you.

  • Oracle 8.1.5 and JDBC OCI connection problem

    We are running Oracle 8.1.5 on Solaris 7 machine, and our java application running on JDK 1.2 connects to Oracle via JDBC thin driver because we couldn't make jdbc oci driver work.
    When we try to connect via oci with the driver originally shipped with 8.1.5, we get:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:213)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at JDBCTest.main(Compiled Code)
    After we downloaded 8.1.6sdk driver from technet and install it, we get:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Error.<init>(Error.java:50)
    at java.lang.LinkageError.<init>(LinkageError.java:43)
    at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:42)
    at java.lang.ClassLoader.loadLibrary(Compiled Code)
    at java.lang.Runtime.loadLibrary0(Runtime.java:471)
    at java.lang.System.loadLibrary(System.java:745)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:209)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at JDBCTest.main(Compiled Code)
    I searched this forum for answer and only relevent answer from oracle was: consult README file! Readme file mentions that lobocijdbc.so file is shared library file for oci connection. That't all. So what?
    I added the directory where libocijdbc8.so resides to LD_LIBRARY_PATH, and System.getProperty("java.library.path") shows content of LD_LIBRARY_PATH correctly.
    null

    Please this is not simple as simple as checking the classpath and LD_LIBRARY_PATH.
    I tried the sample program and the result is the same. As pointed out first by Won, putting the libocijdbc8.so from SDK8.1.6 in the LD_LIBRARY_PATH has no effect at all. It gives the unsatisfied linker error. The sample program fails. However the sample program works fine with the libocijdbc8.so from sdk8.1.5. The library gets loaded. But at the time of creating the connection it gives make_c_state error.
    Here is my CLASSPATH, PATH and LD_LIBARY_PATH variables
    ORACLE_HOME=/opt/oracle/product/8.1.5
    LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/oracle/product/8.1.5/lib
    PATH=/usr/openwin/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/ucb:/opt/oracle/product/8.1.5/lib
    Hope you are able to provide better answer then check your environment variables.
    THE libocijdbc8.so FROM SDK8.1.6 DOES NOT GET LOADED AT ALL.
    Waiting for the reply.
    Please Help.
    Regards,
    Vipul Modi.
    Novell Inc.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Won, Taewoong([email protected]):
    We are running Oracle 8.1.5 on Solaris 7 machine, and our java application running on JDK 1.2 connects to Oracle via JDBC thin driver because we couldn't make jdbc oci driver work.
    When we try to connect via oci with the driver originally shipped with 8.1.5, we get:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:213)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at JDBCTest.main(Compiled Code)
    After we downloaded 8.1.6sdk driver from technet and install it, we get:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Error.<init>(Error.java:50)
    at java.lang.LinkageError.<init>(LinkageError.java:43)
    at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:42)
    at java.lang.ClassLoader.loadLibrary(Compiled Code)
    at java.lang.Runtime.loadLibrary0(Runtime.java:471)
    at java.lang.System.loadLibrary(System.java:745)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:209)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at JDBCTest.main(Compiled Code)
    I searched this forum for answer and only relevent answer from oracle was: consult README file! Readme file mentions that lobocijdbc.so file is shared library file for oci connection. That't all. So what?
    I added the directory where libocijdbc8.so resides to LD_LIBRARY_PATH, and System.getProperty("java.library.path") shows content of LD_LIBRARY_PATH correctly.
    <HR></BLOCKQUOTE>
    null

  • JDBC Receiver Adapter to connect to oracle

    Hi all,
    We are configuring communication channel for receiver JDBC Adapter to connect to oracle dataabase. The status is red in the Adapter monitor and it says that
    "Receiver Adapter v1027 for Party '', Service 'MQ':
    Configured at 23:31:45 2006-12-12
    Processing Error: Accessing database connection 'jdbc:odbc://172.20.36.170:1521;DatabaseName=RTPOC failed: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Addtional information: JDBC driver 'oracle.jdbc.driver.OracleDriver' loaded successfully, additional driver information:
    Available JDBC drivers:
        oracle.jdbc.driver.OracleDriver, 1.0 JDBC compliant
        sun.jdbc.odbc.JdbcOdbcDriver, 2.1 JDBC compliant
    I guess there is some error in the connection url....could someone give us the exact syntax of Connection url.
    Regards

    Hi all,
    someone please clarify me. I have a datasource called "OracleDSN" in system 172.20.36.239 which has oracle client(RTPOC) in it.
    So i gave my connection url as
    jdbc:odbc:OracleDSN:@172.20.36.239:1521:RTPOC.
    it still says that datasource name is too long..
    Please help us out.
    Regards

  • [b]Connection to Oracle DB per JDBC URGENT HELP NEEDED PLEASE![/b]

    Hallo,
    I'm a newbie. I want to make a connection to the oracle db on the server and I have been having serious problems. See CODE and ERROR MESSAGEs below:
    import java.sql.*;
    public class SqlConnection01 {
         public static void main(String[] args) {
              Connection con = null;
              Statement stmt = null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver"); //Loading the Oracle Driver.
    con = DriverManager.getConnection
         ("jdbc:oracle:thin:@38.218.2.227:1521:testdb","data","test"); //making the connection.
                   stmt = con.createStatement ();// Sending a query to the database
                   ResultSet rs = stmt.executeQuery("SELECT mand,kost,ktest,kok FROM test");
                        while (rs.next()) {
                             String mandt = rs.getString("1");
                             String kostl = rs.getString("2");
                             String ktest = rs.getString("3");
                             String kokrs = rs.getString("4");
                             System.out.println( mandt + kostl ktest kokrs );
              } catch(Exception e) {
                   e.printStackTrace();
              } finally {
                   try
                        if(stmt != null) stmt.close();
                        if(con != null) con.close();
                   } catch (Exception exception) {
                        exception.printStackTrace();
    ERROR MESSAGE:
    java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
         at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3695)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:362)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:536)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:328)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at SqlConnection01.main(SqlConnection01.java:24)
    What am I doing wrong here. I am using Oracle9i client installed on my pc (Release 2 (9.2.0.1.0) for Windows ) so I downloaded the ojdbc14 drivers for this version and I copied them in my bin directory C:\j2sdk1.4.2_06\bin\ojdbc14 .
    Secondly I can connect to the db per command line( sqlplus /nolog; conn data/test@testdb) and querry the testdb.
    I can also test the connection using oracle Net Manager and the test is successful.
    But I can't start up the lsnrctl on my pc.I get this message any time i issue the command(C:\>lsnrctl
    'lsnrctl' is not recognized as an internal or external command, operable program or batch file.)
    What am I doing wrong here? What should I do to have this connection possible. Thanks very much in advance.

    oh sure! Below is the TNSNAMES I copied from my PCfound in(C:\oracle\ora92\network\admin\SAMPLE) The next thing could be how could I get access to the TNSNAMES on the server?
    STARTS HERE:
    <alias>= [ (DESCRIPTION_LIST =  # Optional depending on whether u have
                        # one or more descriptions
                        # If there is just one description, unnecessary ]
         (DESCRIPTION=
         [ (SDU=2048) ]     # Optional, defaults to 2048
                        # Can take values between 512 and 32K
         [ (ADDRESS_LIST=    # Optional depending on whether u have
                        # one or more addresses
                        # If there is just one address, unnecessary ]
         (ADDRESS=
              [ (COMMUNITY=<community_name>) ]
              (PROTOCOL=tcp)
              (HOST=<hostname>)
              (PORT=<portnumber (1521 is a standard port used)>)
         [ (ADDRESS=
              (PROTOCOL=ipc)
              (KEY=<ipckey (PNPKEY is a standard key used)>)     
         [ (ADDRESS=
              [ (COMMUNITY=<community_name>) ]
              (PROTOCOL=decnet)
              (NODE=<nodename>)
              (OBJECT=<objectname>)
    ... # More addresses
         [ ) ] # Optional depending on whether ADDRESS_LIST is used or not
         [ (CONNECT_DATA=
              (SID=<oracle_sid>)
              [ (GLOBAL_NAME=<global_database_name>) ]
         [ (SOURCE_ROUTE=yes) ]
         (DESCRIPTION=
         [ (SDU=2048) ]     # Optional, defaults to 2048
                        # Can take values between 512 and 32K
         [ (ADDRESS_LIST= ]     # Optional depending on whether u have more
                        # than one address or not
                        # If there is just one address, unnecessary
         (ADDRESS
              [ (COMMUNITY=<community_name>) ]
              (PROTOCOL=tcp)
              (HOST=<hostname>)
              (PORT=<portnumber (1521 is a standard port used)>)
         [ (ADDRESS=
              (PROTOCOL=ipc)
              (KEY=<ipckey (PNPKEY is a standard key used)>)
         ...           # More addresses
         [ ) ]           # Optional depending on whether ADDRESS_LIST
                        # is being used
         [ (CONNECT_DATA=
              (SID=<oracle_sid>)
              [ (GLOBAL_NAME=<global_database_name>) ]
         [ (SOURCE_ROUTE=yes) ]
         [ (CONNECT_DATA=
         (SID=<oracle_sid>)
         [ (GLOBAL_NAME=<global_database_name>) ]
         ... # More descriptions
         [ ) ]     # Optional depending on whether DESCRIPTION_LIST is used or not
    I think this is the example of what is in the TNSNAMES. It hasn't got the infos I need here.It just explain.

  • Problem in jdbc connect thru oracle

    hi all
    i hv installed oracle 8i on win2k
    i wanna connect thru jdbc
    but i am getting error below
    i donno whr i got struck?
    plz help me
    thnx in advance
    bye
    ////////// details ///////////////////////
    import java.sql.*;
    ///win2000,oracle 8i
    /// try to fix whr i hv done mistake
    import java.io.*;
    class JDBC1
    public static void main(String[] args)
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver ");
    //// i tried all below connections
    Connection cn=DriverManager.getConnection("jdbc:odbc:santhu:PLSExtProc","scott","tiger"); /// oracle_sid=santhu hv given
    //Connection cn= DriverManager.getConnection("jdbc:odbc:PLSExtProc","scott","tiger"); /// PLSExtProc it is given in tnsnames.ora file
    //Connection cn=DriverManager.getConnection("jdbc:odbc:oracle:PLSExtProc","scott","tiger"); /// driver name i hv given as oracle and one more as santhu--both for oracle driver
    Statement st=cn.createStatement();
    ResultSet rs=st.executeQuery("select * from dept");
    int dno;
    String dname;
    while(rs.next())
    dno=rs.getInt("deptno");
    dname=rs.getString("dname");
    System.out.println(dno+dname);
    catch(Exception e)
    System.out.println(e);
    /// compiled successfully
    /// but runtime error::SQLException---data source name not found no default driver specified
    //// saying tns-12538 error
    /// tnsping-----error is coming.........
    /// lsnrctl start --------is not working
    //// lsnrctl status ------is also not working
    /// in services i hv set oraclelistener to auotmatic start
    /// in net8 configuration assistent everything is ok
    /// try to do it today...ok na
    // i put classpath to home dir of oracle
    ///////////listener.ora file //////////////////////////////
    # LISTENER.ORA Network Configuration File: D:\Oracle\Ora81\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Vaman)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vaman)(PORT = 2481))
    (PROTOCOL_STACK =
    (PRESENTATION = GIOP)
    (SESSION = RAW)
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\Oracle\Ora81)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = santhu)
    (ORACLE_HOME = D:\Oracle\Ora81)
    (SID_NAME = santhu)
    /////////////////tnsnames.ora file///////////////////
    # LISTENER.ORA Network Configuration File: D:\Oracle\Ora81\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Vaman)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vaman)(PORT = 2481))
    (PROTOCOL_STACK =
    (PRESENTATION = GIOP)
    (SESSION = RAW)
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\Oracle\Ora81)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = santhu)
    (ORACLE_HOME = D:\Oracle\Ora81)
    (SID_NAME = santhu)
    ////////////////////////////////////////////////

    Class.forName("oracle.jdbc.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");
    You can find OracleDriver in classes12.jar (<ORA_HOME>/jdbc).
    Check your tnsnames.ora file for <hostname> and <database name>. For example, if you had a following entry in tnsnames.ora file:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SOMEHOST)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    you would write:
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@SOMEHOST:1521:XE", "scott", "tiger");

  • Throws Exception when jdbc connect to Oracle

    Hi! I'm waiting for your answers.
    When i use jdbc to connect Oracle,system throws exceptions as follows:
    java.lang.ClassCastException: oracle.sql.converter.CharacterConverter12Byte
    oracle.sql.CharacterSet1Byte oracle.sql.CharacterSet1Byte.getInstance (int,racle.sql.converter.CharacterConverter)
              CharacterSet1Byte.java:82
         oracle.sql.CharacterSet oracle.sql.CharacterSetWithConverter.getInstance(int)     CharacterSetWithConverter.java:85
    I code in Oracle9i Jdeveloper 9.0.2. The Oracle version is 9.0.2.
    My code example is as follows:
    package mypackage2;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class Class1
    public Class1()
    public static void main(String[] args)
    Class1 class1 = new Class1();
    Connection conn = null;
    try
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //exception throws in getConnection()
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:CR","system","CR2001");
    catch (Exception e)
    e.printStackTrace();

    import java.io.*;
    import java.sql.*;
    import java.text.*;
    import oracle.jdbc.driver.*;
    public class viewtable
         Connection con;
         Statement st;
         public viewtable (String args[]) throws ClassNotFoundException,FileNotFoundException,IOException,SQLException
         url="jdbc:oracle:thin:system/manager@IP:1521:SID";
         Class.forName ("oracle.jdbc.driver.OracleDriver");
         try
         con=DriverManager.getConnection(url);
              st = con.createStatement ();
              doexample ();
              st.close ();
              con.close ();
         }catch(SQLException e)
              System.err.println(e.getMessage());
         public void doexample () throws SQLException
         ResultSet rs = st.executeQuery("select * from sales");
              if(rs!=null) {
              while(rs.next())
                   int a = rs.getInt("no");                    System.out.println("NO = "+a);
              rs.close();
         public static void main (String args[])
              System.out.println ("Oracle Exercise 1 \n");
              try
                   viewtable test = new viewtable(args);
              } catch (Exception ex)
                   System.err.println ("Exception caught.\n"+ex);
                   ex.printStackTrace ();
    the above is the full code, please check the problem....many thanks

  • Oracle Not Avaliable on 8.1.6 for Linux with JDBC Thin Connection

    HI All,
    While I m trying to connect the Oracle 8.1.6 server with the JDBC Thin driver I m getting Error
    ORA - 01034 Oracle not Available.
    I m using jdk 1.2.2 and in the Classpath I have given the path for classes12.zip.
    I have tried using classes111.zip file though I m getting same Error Message.
    Anybody can help me out.
    Thanx,
    Chirag oza
    null

    did you have your oracle database running?
    01034, 00000, "ORACLE not available"
    // *Cause: Oracle was not started up. Possible causes include the following:
    // - The SGA requires more space than was allocated for it.
    // - The operating-system variable pointing to the instance is
    // improperly defined.
    // *Action: Refer to accompanying messages for possible causes and correct
    // the problem mentioned in the other messages.
    // If Oracle has been initialized, then on some operating systems,
    // verify that Oracle was linked correctly. See the platform
    // specific Oracle documentation.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by chirag oza ([email protected]):
    HI All,
    While I m trying to connect the Oracle 8.1.6 server with the JDBC Thin driver I m getting Error
    ORA - 01034 Oracle not Available.
    I m using jdk 1.2.2 and in the Classpath I have given the path for classes12.zip.
    I have tried using classes111.zip file though I m getting same Error Message.
    Anybody can help me out.
    Thanx,
    Chirag oza
    <HR></BLOCKQUOTE>
    null

  • JDBC Connectivity to Oracle 8i Database

    I'am facing problem in connecting to Oracle 8i server using oci8 JDBC driver provided by Oracle.
    The statemnet that gives me error is --
    Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + "MIS", "scott", "tiger");
    This throws an exception
    java.lang.UnsatisfiedLinkError : make_c_state.
    Can anyone please tell me where i'am going wrong?
    Thanx in advance

    Really need to know the platform on which you're trying to execute the code. Each client will need to have the standard Oracle client software installed (with the NET8 configuration application, which provides the 'drivers')
    On Oracle's metalink see some responses
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=121922.1
    Overview
    This example provides a minimal test program used to verify that the client
    environment is set up properly for running the JDBC OCI driver in order to avoid
    receiving the 'unsatisfied link error' caused by an incorrect LD_LIBRARY_PATH.
    Program Notes
    Simply copy the code below to a file called Test.java. Compile and run the
    file from the client environment that you intend to use for your JDBC
    applications.
    References
    [NOTE:118756.1]
    Caution
    The sample program in this article is provided for educational purposes only
    and is NOT supported by Oracle Support Services. It has been tested
    internally, however, and works as documented. We do not guarantee that it
    will work for you, so be sure to test it in your environment before relying
    on it.
    Program
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - - - - - -
    public class Test {
    public static void main (String [] args)
    try
    System.loadLibrary("ocijdbc8");
    System.out.println("Successfully Loaded");
    } catch(Exception e)
    System.out.println("LD_LIBRARY_PATH is not properly set");
    e.printStackTrace();
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - - - - - -
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=118756.1
    which is:
    I'm getting Unsatisfied Link Error with Oci 8 Driver ?
    First, make sure that the jdbc-oci shared object (libocijdbc8 or liboci80Xjdbc.so etc.) and ${ORACLE_HOME}/lib are in your path. Then, try this Sample Program. Some times, even after the shared object is loaded successfully, you may get errors such as make_c_state symbol not found. This may happen if your CLASSPATH has classes.zip from JRE 1.1.7 or JDK 1.1.6 and your running java binaries from jdk 1.1.3 or so. Make sure everything (LD_LIBRARY_PATH, CLASSPATH, java binaries) is in SYNC.

  • JDBC Connection to Oracle 8i

    Hi All,
    I hope someone will help me.
    I am trying to connect to Oracle 8i using the JDBC "thin" driver on Windows 2000 prof. The program is compiled successfully but got error "ClassNotFoundException: Unable to find class oracle.jdbc.driver.OracleDriver" when try to run. Please see code below for your review:
    import java.io.*;
    import java.sql.*;
    import java.net.*;
    import java.lang.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class emp extends HttpServlet
         public void doGet(
              HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
              res.setContentType("Text/html");
              PrintWriter out = res.getWriter();
              out.println("<HTML>");
              out.println("<TITLE>Simple Emp Details</TITLE>");
              out.println("<BODY BGCOLOR=\"#FFFFFF\">");
              out.println("<CENTER><B>Employees</B></CENTER>");
              out.println("<BR>");
              Connection conn = null;
              try
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   conn = DriverManager.getConnection("jdbc:oracle:thin:@satya:1521:satya", "scott", "tiger");
                   Statement stmt = conn.createStatement();
                   ResultSet rs = stmt.executeQuery("SELECT ENAME, JOB FROM EMP");
                   while(rs.next())
                        out.println("<BR>");
                        out.println(rs.getString("ENAME") + " - " + rs.getString("JOB"));
                        out.println("<BR>");
                   out.println();
              catch(SQLException ex)
                   out.println("SQL EXception:     " + ex.getMessage() + "<BR>");
                   while((ex = ex.getNextException()) != null)
                        out.println(ex.getMessage() + "<BR>");
              catch(ClassNotFoundException clsex)
                   out.println("ClassNotFoundException:     " + clsex.getMessage() + "<BR>");
              finally
                   if(conn != null)
                        try
                             conn.close();
                        catch(Exception ignored) {}
              out.println("</BODY></HTML>");
    Can you please also give me precise syntax and explanation for DriverManager.getConnection i.e. DriverManager.getConnection("jdbc:oracle:thin:@satya:1521:satya", "scott", "tiger");
    Many thanks in advance for your great cooperation,
    Satya

    The error is caused by the runrime VM not finding the Oracle JDBC driver. You need to make sure that the file containing the driver (usually classes12.zip) is in the classpath of your application server. Check the doco that comes with your app server to learn how to set this up.
    For info about the parameters to getConnection() for Oracle see the Oracle JDBC developers guide and reference.
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/basic1.htm#1000881
    Since you appear to be using a J2EE app server you'll probably want to use the JDBC connection pooling it supplies rather than DriverManager.getConnection(). Check out the doco that comes with your app server and read the section about DataSource here http://developer.java.sun.com/developer/Books/JDBCTutorial/index.html

  • How to use JDBC to connect Oracle databse

    Hi
    I try to connect the oracle databse by using JDBC. But I not sure whether is it correct or not because I learnt from the documentation provided by WWW.JAVA.SUN.
    I have create a ODBC DSN file call TKS username/password : tem/manager
    then I download the source code and enhance a bit as following :
    import java.sql.*;
    public class CreateCoffees
    public static void main(String args[])
         String url = "jdbc:oracle:thin:tem/manager@(
         description=(address_list=(
         address=(protocol=tcp)
         (host=192.9.200.8)(port=1521)))(source_route=yes)
         (connect_data=(sid=tks)))";
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
         catch(java.lang.ClassNotFoundException e)
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, "tem", "manager");
    stmt = con.createStatement();
    stmt.executeUpdate(createString);
    stmt.close();
    con.close();
         catch(SQLException ex)
         {  System.err.println("SQLException: " + ex.getMessage());
    After that I saved the file as CreateCoffees.java and compiled it
    D:\KLTAY\JAVA>javac CreateCoffees.java
    CreateCoffees.java:6: unclosed string literal
    String url = "jdbc:oracle:thin:tem/manager@(
    ^
    CreateCoffees.java:10: unclosed string literal
    (connect_data=(sid=tks)))";
    ^
    CreateCoffees.java:30: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    con = DriverManager.getConnection(url, "tem", "manager");
    ^
    CreateCoffees.java:31: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    stmt = con.createStatement();
    ^
    CreateCoffees.java:34: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    con.close();
    ^
    5 errors
    Please give some advise.Thanks
    best regards,
    Tay

         String url = "jdbc:oracle:thin:tem/manager@(
         description=(address_list=(
         address=(protocol=tcp)
         (host=192.9.200.8)(port=1521)))(source_route=yes)
         (connect_data=(sid=tks)))";
    After that I saved the file as CreateCoffees.java and
    compiled it
    D:\KLTAY\JAVA>javac CreateCoffees.java
    CreateCoffees.java:6: unclosed string literal
    String url = "jdbc:oracle:thin:tem/manager@(
    ^
    CreateCoffees.java:10: unclosed string literal
    (connect_data=(sid=tks)))";
    ^I would suggest putting all code between the quotesj(") on one line and then attempting to recompile.

Maybe you are looking for