Oracle database Connectivity using OCI driver

I am getting the error only when ever I am using oci driver
oracle.url=jdbc:oracle:oci:@(description=(address=(host=url.name.com)(protocol=tcp)(port=1521))(connect_data=(sid=user)))
04:52:55,093 ERROR [STDERR] java.sql.SQLException: ???S???Y??x??
04:52:55,094 ERROR [STDERR] at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
04:52:55,094 ERROR [STDERR] at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:650)
04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338)
04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133)
04:52:55,096 ERROR [STDERR] at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
04:52:55,096 ERROR [STDERR] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
04:52:55,096 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:582)
04:52:55,096 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:185)
04:52:55,097 ERROR [STDERR] at org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
04:52:55,097 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
04:52:55,097 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
04:52:55,097 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
04:52:55,097 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
04:52:55,098 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
04:52:55,098 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
04:52:55,098 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
04:52:55,098 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
04:52:55,099 ERROR [STDERR] at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63)
04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
04:52:55,100 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
04:52:55,100 ERROR [STDERR] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
04:52:55,100 ERROR [STDERR] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
04:52:55,100 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
04:52:55,101 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
04:52:55,101 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
04:52:55,101 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
04:52:55,101 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
04:52:55,101 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
04:52:55,102 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
04:52:55,102 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
04:52:55,102 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
04:52:55,102 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
04:52:55,102 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
04:52:55,103 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
04:52:55,105 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[Test].[jsp]] Servlet.service() for servlet jsp threw exception: java.sql.SQLException: ???S???Y??x??
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:650) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
at java.sql.DriverManager.getConnection(DriverManager.java:582) [:1.6.0_13]
at java.sql.DriverManager.getConnection(DriverManager.java:185) [:1.6.0_13]
at org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.20100911-M5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Beta2]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.20100911-M5]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.20100911-M5]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.20100911-M5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Beta2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.20100911-M5]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:6.0.0.20100911-M5]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100911-M5]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100911-M5]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100911-M5]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100911-M5]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20100911-M5]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.20100911-M5]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [:6.0.0.20100911-M5]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.20100911-M5]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_13]
When I am using thin driver, I am successful in connecting to the database
oracle.url=jdbc:oracle:thin:@(description=(address=(host=url.name.com)(protocol=tcp)(port=1521))(connect_data=(sid=user)))
I am using JBOSS 1.6 with oracle 11.1.0 and jdk 1.6
Please help me resolve the problem
Thanks,
Kumar

You should confirm that you can connect to the DB with a simple Java class using the url that the code you posted is using.
This will show that the OCI client is installed and executing properly. If you can't connect externally you will need to fix that first.
Is the Oracle client installed on the same machine the JDBC code is running on?

Similar Messages

  • Problem JDBC Connection using OCI Driver on Weblogic Portal on Linux

    Hi Team,
    I want a JDBC connection using OCI Driver in Weblogic Portal 8.1 sp4 on Linux. When I had tested using JDBC connection using Plain Java Code it is working. Also when I create the OCI Connection Weblogic Connection Pool it is working.
    But My Requirement is to create the connection using Java Code in Portal Application
    But When I create OCI connection in the code it is throwing NO SUITABLE DRIVER Found.
    ---------- Code in Plain Java Code ------------ Same code is used in Weblogic Portal Application --------------------------------
         public static void main(String[] args) throws Exception{
              Class.forName("oracle.jdbc.driver.OracleDriver");
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              String url="jdbc:oracle:oci8:@TESTDB";
              Properties props = new Properties();
         props.put("user","scott");
         props.put("password","tiger");
              conn=DriverManager.getConnection(url,props);
    When I am using the same code in Weblogic Portal and Deployed on Weblogic Portal Server 8.1 SP4 it is throwing following error.
    -------------- Exception on Server Log --------------------
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)Ljava.sql.Connection;(Unknown Source)
    at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;)Ljava.sql.Connection;(Unknown Source)
    My Environment is
    LINUX
    Weblogic 8.1 SP4
    Oracle 9i Client on Same Machine
    Oracle 10g Server on Different Machine
    My Environment Variables on the Linux Server also set properly as following
    PATH=/apps/pmaaum/ant/apache-ant-1.6.5/bin:.:/apps/beahomedev/jdk142_05/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/product/9.2.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/bin
    LD_LIBRARY_PATH=/usr/lib:/apps/oracle/ora9i/product/9.2.0/lib:/apps/oracle/ora9i/product/9.2.0/lib32:/apps/oracle/ora9i/product/9.2.0/rdbms/lib:/usr/openwin/lib:/apps/oracle/ora9i/product/9.2.0/jdbc/lib
    JAVA_HOME=/apps/beahomedev/jdk142_05
    JDBC_LIB=/apps/oracle/ora9i/product/9.2.0/jdbc/lib
    CLASSPATH=:.:/apps/beahomedev/jdk142_05/lib/rt.jar:/apps/oracle/ora9i/product/9.2.0/jdbc/lib/classes12.jar
    Please help me, Let me know if you required anything.
    Thanks in Advance
    Vishnu
    Edited by: vishnuk on Oct 23, 2009 4:07 AM
    Edited by: vishnuk on Oct 23, 2009 4:10 AM

    Hi Vishnu
    Looks like a classloader issue. BEA class loader is very tricky. Any jar added manually in classpath, will end up loading only those classes. Any imports that we have in any of those classes do not get loaded. Anyhow, coming to your point, add classes12.jar inside your portal web project Web-Inf/lib folder and see if that helps. Usually thats where we put all the JARs for 8.1 SPxx applications. If this still breaks, then remove the jar from web-inf/lib folder and add under your portal app App-Inf/lib folder. First try with app-inf/lib folder having this jar. If not then with web-inf/lib. Basically web-inf is specific to that web app only. If you have a different app having this jdbc code, then put under app-inf/lib folder. Make sure that you remove the classes12.jar that you added in classpath either in env variable or in setdomainenv.cmd file.
    When weblogic uses native OCI Drivers, it refers to jars at this location: ....\beawlp814\weblogic81\server\ext\jdbc\oracle\10g or 9g. Try using one of these jars and see if that works. Most of the times I used these jars only for oracle specific native drivers.
    Word of caution. Try to use Connection Pool and a DataSource created in weblogic console for your jdbc code. This Datasource can still use the Oracle drivers that you want (instead of BEA Weblogic wrapper oci drivers) located in above location. Use JNDI Lookup and get Datasource and then connection. This is more recommended approach with many advantages then using DriverManager approach..
    Goud

  • Probem with databse connection using OCI driver

    hai folks,
    Iam using OCI driver to connect to the database.
    the program is compiling successfully but during runtime it is showing invalid url
    my code follows and my SID value is "mohan"
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.*;
    import java.math.BigDecimal;
    public class ArrayExample
         ResultSet rs;
    public static void main (String args[])
    throws Exception
         String driver="oracle.jdbc.driver.OracleDriver";
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    String url="jdbc:oracle://oci8:/@mohan";
    Class.forName(driver);
    Connection conn=DriverManager.getConnection(url,"SCOTT","TIGER");
    DriverManager.getConnection("jdbc:oracle://oci8:/@","scott","tiger") ;
    Statement stmt = conn.createStatement ();
    try
    stmt.execute ("DROP TABLE varray_table");
    stmt.execute ("DROP TYPE num_varray");
    System.out.println("mohan");
    catch (SQLException e)
    System.out.println(e);
    stmt.execute ("CREATE TYPE num_varray AS VARRAY(10) OF NUMBER(12, 2)");
    stmt.execute ("CREATE TABLE varray_table (col1 num_varray)");
    stmt.execute ("INSERT INTO varray_table VALUES (num_varray(100, 200))");
    ResultSet rs = stmt.executeQuery("SELECT * FROM varray_table");
    showResultSet (rs);
    int elements[] = { 300, 400, 500, 600 };
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("NUM_VARRAY", conn);
    ARRAY newArray = new ARRAY(desc, conn, elements);
    PreparedStatement ps =
    conn.prepareStatement ("insert into varray_table values (?)");
    ((OraclePreparedStatement)ps).setARRAY(1, newArray);
    ps.execute ();
    ResultSet rs = stmt.executeQuery("SELECT * FROM varray_table");
    showResultSet (rs);
    rs.close();
    ps.close();
    stmt.close();
    conn.close();
    public static void showResultSet (ResultSet rs)
    throws SQLException
    int line = 0;
    while (rs.next())
    line++;
    System.out.println("Row "+line+" : ");
    ARRAY array = ((OracleResultSet)rs).getARRAY (1);
    System.out.println ("Array is of type "+array.getSQLTypeName());
    System.out.println
    ("Array element is of typecode "+array.getBaseType());
    System.out.println ("Array is of length "+array.length());
    BigDecimal[] values = (BigDecimal[]) array.getArray();
    for (int i=0; i<values.length; i++)
    BigDecimal value = (BigDecimal) values;
    System.out.println(">> index "+i+" = "+value.intValue());
    please help me in sloving this problem
    my global database name and SID value in mohan
    Thanking u

    Bathina,
    Your problem is in your URL:
    String url="jdbc:oracle://oci8:/@mohan";As far as I know, you can't use the forward-slash character ("/"), by itself, as your database login name -- you must supply a "login/password". I don't know why, and if you don't like it, I suggest you create a TAR (Technical Assistance Request) via the MetaLink Web site.
    I recall similar questions being asked in this forum -- have you tried searching the forum archives?
    Good Luck,
    Avi.

  • Not able to connect to Database By Using OCI Driver

    Hi All,
    I am trying to connect my application to Database using Type 2 OCI driver..
    I am getting this exception:
    {color:#ff0000}*Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause: java.sql.SQLException: ORA-12154: TNS:could not resolve the connect identifier specified*
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:672)
    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:346)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
    at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
    at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:82)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:300)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:838)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:821)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:513)
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:767)
    at com.uprr.app.csl.dao.EventDAOImpl.insertEvent(EventDAOImpl.java:62)
    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:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:280)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:69)
    at com.uprr.app.csl.common.util.LatPerformanceLogInterceptor.aroundAdvice(LatPerformanceLogInterceptor.java:143)
    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:585)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:553)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:542)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:56)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
    at $Proxy2.insertEvent(Unknown Source)
    at Test.getData(Test.java:19)
    at Test.main(Test.java:30)
    {color:#000000}My JDBC URL IS jdbc:oracle:oci
    {color}
    {color:#000000}Thanx a lot in advance
    Samit{color}
    {color}

    {color:#000000}My JDBC URL IS jdbc:oracle:oci {color}That url is not complete, check out [http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_03].

  • How to check the database connection using OCI

    I am working on enhhancement of very old application developed using C and OCI. It has a background process which acts as a middleware for interaction of any other front end process with oracle database. Any processes, which needs to interact with database sends a request to background peocess and then it will execute a call to execute the stored procedures for performing requested operation (like select, update, insert) on table and will send the result back to respective process. So this process has to be always running in background and connected to branch database.
    If branch database gets restarted or connection gets dropped due to some ad-hoc problem then the background process also has to be restarted manually. Because this process establishes the connection to branch database only once on start up and it does not have the intelligence to reconnect automatically in such scenario.
    I am looking forward to build the intelligence in this process to automatically reconnect if connection with branch database is lost. But I am not familer with OCI, and I am not sure if there is any OCI call which can determine if my earlier connection is still available. Can any one please tell me if there is any other way to check the connection other than the execution of dummy query, then check if it gets executed properly and then do the actual query.
    Thanks in advance,
    Deeapk

    Hi,
    If you are reworking the application can you not build in the functionality to re-establish a connection if there is a failure? That is, a submission from the application server to the database server detects a failure, etc. and then re-establishes the connection. If you need a more frequent check than during a user-initiated roundtrip, you may be best served by using the "dummy query" technique on some time interval.
    From my understanding using HA Event Notification would require a RAC database (plus a multi-threaded application and services correctly configured on the RAC-side).
    In the documentation I see this:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci09adv.htm#sthref1495
    "Applications must connect to a RAC instance to enable HA event notification."
    In any case, this has the potential to be a bit complicated...
    Regards,
    Mark

  • Oracle database connectivity using oledb provider and atl classes in c++

    dear friend ,
    i m connecting oracle database in c++. i m using ATL classes and oledb provider for oracle. however i m facing some defficulties in stored procedure.
    Normally MYSQL and sql server database is resulting result set in stored procedure i.e. we can use " select * from tablename" query in c++ to returning result. but in oracle we can not use this approch as because it dosent support. so how can i execute below stored procedure in c++ code. i have to retuen result set in STP. i m using SYS_REFCURSER in oracle . but how do i execute it in c++ code.
    create PROCEDURE stp_getRecord ( p_curser SYS_REFCURSER) as
    begin
    open p_curser for select * from table_name;
    end;
    please help me asap.

    I tried it, commented out the reader.read and have the following connection string
    string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****; OLEDB.NET=True"
    Unfortunately the result is the same.
    Edited by: Dino2dy on Nov 24, 2011 12:53 AM

  • Database connection using embedded driver

    I have a small application that relies on data stored in an underlying Java DB database. If I use the following to connect to the database, the application works:
    derbyclient.jar in the main class CLASSPATH
    public static final String DRIVER_NAME = "org.apache.derby.jdbc.ClientDriver";
    public static final String DATABASE_URL = "jdbc:derby://localhost:1527/UnitConverters";
    BUT...if I use the embedded driver, it does not work:
    derby.jar in the main class CLASSPATH
    public static final String DRIVER_NAME = "org.apache.derby.jdbc.EmbeddedDriver";
    public static final String DATABASE_URL = "jdbc:derby:UnitConverters";
    The error I get when I try using the embedded driver is: java.sql.SQLException: Database 'UnitConverters' not found.
    Here's what I'm using to connect to the database (for both scenarios):
    public void init() {
    try {
    Class.forName(DRIVER_NAME);
    myConnection = DriverManager.getConnection(DATABASE_URL,"user","pass");
    } catch (SQLException ex) {
    ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
    ex.printStackTrace();
    Thanks in advance for your help,
    Greg.

    Yes, there was. I've been trying examples and
    googling for a couple of days now, and I can't get it
    to work. Thanks for your help, though--at least I got
    a different error message this time! ;)Try this, it is a sample I used to get connected in embedded mode.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.Properties;
    public class DatabaseConnection {
        private String driver = "org.apache.derby.jdbc.EmbeddedDriver";
        private String protocol = "jdbc:derby:";
        public static void main(String[] args) {
              new DatabaseConnection();
        private DatabaseConnection() {
             try{
                   Class.forName(driver).newInstance();
                 Connection conn = null;
                 Properties props = new Properties();
                 props.put("user", "user1");
                 props.put("password", "user1");
                 conn = DriverManager.getConnection(protocol +
                         "derbyDB;create=true", props);
                 System.out.println("Connected to and created database derbyDB");
                 conn.setAutoCommit(false);
             } catch (SQLException e) {
             } catch (InstantiationException e) {
                   e.printStackTrace();
              } catch (IllegalAccessException e) {
                   e.printStackTrace();
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
    }

  • Oracle Database Connection using JSP

    I am attempting to create a simple web app using Oracle 9i and JSP. I am trying to create a connection to my database and do not seem to be having much luck. I have worked with ASP and can find my way around fairly well in that environment, however, JSP seems to be not as closely related as I initially thought. Can anyone point me to a good site that can give a beginner the basics on using this technology. I have been to several sites off of Oracle and Sun, but I seem to be more confused after reading them. With JSP, can I code as I would in ASP i.e JavaScript, etc? I have downloaded and installed the JDBC drivers from Oracle's website, but I receive errors when trying to establish a connection. If there is a site that can explain from the ground up how to set up a connection, I would be very greatful!

    Hi,
    This example uses Interbase, but hopefully you will find it useful anyway -
    http://www.kpi.com.au/interbase/connect.jsp
    Cheers,
    Lars

  • Sysdba connectivity using OCI

    Hi guys,
    I have a problem With Oracle sysdba connectivity using OCI.
    Can you any one please forward the Source code to connect SYSDBA using OCI.
    My server is Oracle 10g
    I am using VC++ as interface.
    Please respond,
    Regards,
    kishore

    You should confirm that you can connect to the DB with a simple Java class using the url that the code you posted is using.
    This will show that the OCI client is installed and executing properly. If you can't connect externally you will need to fix that first.
    Is the Oracle client installed on the same machine the JDBC code is running on?

  • Can I use OCI driver to test database connection in JDeveloper9.0.3

    When using JDeveloper 3.2.3, I can use oci8 driver to test the databse connection.
    Then I want oci8 driver work in JDeveloper9.0.2 or JDeveloper 9.0.3. However, it cannot work.
    (Note: but thin driver works fine)
    First, I read the help file and setup ORACLE_HOME environment variable and install
    OCI client driver ocijdbc9.dll on my compuetr. Then some exception is happening when I test again.
    So I want to know, does anyone succeed in testing the connection via oci driver
    and how to fix this problem.
    Thanks a lot.

    Hi !
    You MUST use jdbc library supplied with Oracle client ( so classes12.zip from $ORACLE_HOME/jdbc/lib ), not with JDeveloper - this one might be incopatible with oci native libraries.
    I hope , this helps.
    Michal

  • How to create database connection using DB2Driver in JDeveloper 10.1.2.1.0?

    I am trying to create a JDeveloper/Data Connection using com.oracle.ias.jdbc.db2.DB2Driver. The driver is registered from a User Libraries: DataDirect JDBC. I have the following class path for the library:
    E:\DataDirect\3.4\lib\YMdb2.jar;E:\DataDirect\3.4\lib\YMbase.jar;E:\DataDirect\3.4\lib\YMutil.jar
    I have no trouble configuring the connection but when I test it and I got ‘No suitable driver Vendor code 0’. What’s wrong? I have successfully created several database connections using Oracle thin driver. This is first time I am using a third party driver. Has any one successfully create a database connection using the com.oracle.ias.jdbc.db2.DB2Driver?

    Hi
    Since the error points to the unavailability of the driver class,can you double check your library claspath entries again.
    I just tried a DB2 connection using the following properties and the connection went through fine:
    Driver class name: com.oracle.ias.jdbc.db2.DB2Driver
    URL: jdbc:merant:db2://<host_name>:50000;DatabaseName=SAMPLE
    Thanks
    Prasanth

  • Problem in Oracle Database Connectivity in JSP

    I am having big problem such as Oracle Database connectivity problem
    Following code i am used for database connection. but it throw an exception call class not found exception.
    Pls any one can help me. With a sample code for Oracle Database connection in JSP
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    String url="jdbc:oracle:thin:@172.25.44.54:1521:bbo";
    con = DriverManager.getConnection(url,"user", "user123");
    Thank you

    Well i've never used oracle or their drivers before but i'm presuming that you'd go to oracle.com or something and look for downloads. Otherwise you could goodle for Oracle JDBC drivers. Then just follow the instructions.
    Again i've never used JSP but if you have a manifest file somewhere you'll need to put a class-path: entry in their referecning the jar file with the driver so that it is availble at run-time.
    Wes

  • How to config the oracle database connection pool in IAS

    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

    Jacky,
    You need do the following for oracle type4 driver:
    1) register the driver:
    $IAS_HOME/bin/jdbcsetup
    Driver Identifier: Oracle_Type4_816 (whatever name you like)
    Driver Classname: oracle.jdbc.driver.OracleDriver
    Driver Classpath: .../classes12.zip (install this this zip file somewhere
    and add this zip into the Classpath later).
    2) DataSource Setup:
    start iAS Administration Tool (iASAT)
    Choose Database, unfold iAS1 (your app server instance),
    choose External JDBC Datasource -> add: DataSource Registration
    JNDI Name: yourPoolName
    Driver Type: Oracle_Type4_816 (select what you just register)
    DataSource Url: jdbc:oracle:thin:@hostName:portName:dbName
    Username: your_user_name
    Password: your_passwd
    (Datasource Pool: using defaults for now): you can also customrize the
    parameters for the pool.
    3. Add classes12.zip into CLASSPATH.
    In your application, you can use JNDI lookup to get the DataSource from
    which you get the connection from the pool.
    Hope this helps.
    Good luck.
    Xuran
    "Jacky Yan" <[email protected]> wrote in message
    news:9m0tmp$[email protected]..
    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

  • NetBean, I can't establish the oracle database connection with version 9i.

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

  • Error to connect to oracle 10.2.0.4 using oci driver in solaris

    Urgent Please help me.
    This is the error i am getting when connecting to oracle10.2.0.4 version using oracle oci driver.
    09/10/05 13:52:47 java.lang.UnsatisfiedLinkError: t2cGetCharSet
    09/10/05 13:52:47 at oracle.jdbc.driver.T2CConnection.t2cGetCharSet(Native Method)
    09/10/05 13:52:47 at oracle.jdbc.driver.T2CConnection.getCharSetIds(T2CConnection.java:2954)
    09/10/05 13:52:47 at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:318)
    09/10/05 13:52:47 at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:433)
    09/10/05 13:52:47 at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:141)
    09/10/05 13:52:47 at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
    09/10/05 13:52:47 at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:571)
    09/10/05 13:52:47 at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:217)
    09/10/05 13:52:47 at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:108)
    09/10/05 13:52:47 at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:76)
    09/10/05 13:52:47 at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:58)
    09/10/05 13:52:47 at com.evermind.sql.OrionPooledDataSource.getPooledConnection(OrionPooledDataSource.java:542)
    09/10/05 13:52:47 at com.evermind.sql.PooledConnectionUsage.getPooledConnection(PooledConnectionUsage.java:39)
    09/10/05 13:52:47 at com.evermind.sql.OrionPooledDataSource.checkAndGetMinConnections(OrionPooledDataSource.java:376)
    09/10/05 13:52:47 at com.evermind.sql.OrionPooledDataSource.getTheConnection(OrionPooledDataSource.java:251)
    09/10/05 13:52:47 at com.evermind.sql.OrionPooledDataSource.getTheConnection(OrionPooledDataSource.java:345)
    09/10/05 13:52:47 at com.evermind.sql.OrionPooledDataSource.getConnection(OrionPooledDataSource.java:339)
    09/10/05 13:52:47 at uk.gov.fsa.elms.persistence.base.BaseDataAccess.getValidConnection(BaseDataAccess.java:67)
    09/10/05 13:52:47 at uk.gov.fsa.elms.persistence.base.BaseDataAccess.getConnection(BaseDataAccess.java:125)
    09/10/05 13:52:47 at uk.gov.fsa.elms.persistence.base.dao.BaseDAOImpl.getConnection(BaseDAOImpl.java:76)
    09/10/05 13:52:47 at uk.gov.fsa.elms.processes.batch.ProcessHandler.getProcessId(ProcessHandler.java:48)
    09/10/05 13:52:47 at uk.gov.fsa.elms.processes.batch.ProcessHandler.startProcess(ProcessHandler.java:87)
    09/10/05 13:52:47 at uk.gov.fsa.elms.processes.batch.ProcessManager.startProcess(ProcessManager.java:43)
    09/10/05 13:52:47 at uk.gov.fsa.elms.processes.batch.EventDispatcherServlet$JMSRunner.handleMessage(EventDispatcherServlet.java:306)
    09/10/05 13:52:47 at uk.gov.fsa.elms.processes.batch.EventDispatcherServlet$JMSRunner.run(EventDispatcherServlet.java:355)
    09/10/05 13:52:47 at java.lang.Thread.run(Thread.java:534)

    # 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 = (NTS)I have configured the listener by using NETCA.
    However the TNS connection failed with SQLNET.AUTHENTICATION_SERVICES = (NTS)
    , so I had to disable this parameter

Maybe you are looking for

  • ITunes/QT/Audio/Video Stuttering Fixed!

    The problem is with QuickTime and the fix is to downgrade your version of QT. 1) Download Pacifist to your Desktop. 2) Download the Quicktime 7.3.1 installer from Apple downloads to your Desktop. 3) Double-click the Pacifist dmg and install Pacifist.

  • Folder Corruption - Data loss - Unaccessible data

    Does someone comprehend and know how to recover the Music folder of iTune ? My Music folder = 195Gb of Music (Radio/Promo-Dj etc... valuable stuff rare and own prod) I consolidated my library last night and when I woke up this morning (lovely morning

  • I cannot move icons to the home screen

    Pardon me if this is old, but I cannot find it here via search.  I'm new to iPhone, having had Windows phones, Palm, and others in the past.  Just picked this up today.  Slick.  It even makes AT&T look better.  Here's my question. I understand tap an

  • InDesign document with file extension .M ?

    I just received some inDesign collected art that I need to prepare for a printer. However, the document does not contain the usual indesign extension .indd -- instead it is  filename.M  I cannot open this. I know it was created in inDesign because th

  • My VadoHD 8GB 2nd Gen is not dectecting my laptops

    Hi Support Team, I am pretty much intense because my VadoHD 8GB 2nd Gen is not connecting any of my Lapto ps. Before it used to detect easily on my MacBook Pro and downloads the videos easily. Right now after using around 3 months, its not detecting