?
Solved

Proper URL Connection String when using Oracle oci9 as the protocol to get a JDBC Connection to an Oracle Database from a Weblogic server.

Posted on 2004-09-09
1
Medium Priority
?
1,060 Views
Last Modified: 2013-12-10
Gentlemen,

I am getting a SQL Exception when trying to obtain a jdbc connection using the JDBC libraries of the OCI9 Oracle client.

Since I am using the C:\j2sdk1.4.2_03 SDK in Weblogic(JAVA_HOME value), I included this in my Weblogic classpath:

set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\ojdbc14.jar;%ORACLE_HOME%\ojdbc14_g.jar;%ORACLE_HOME%\ocrs12.jar;
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\nls_charset12.jar;

where ORACLE_HOME is an environment variable set as c:\oracle\ora92\bin

and in my path (this path contains the ocijdbc9.dll):
set PATH=.;%WL_HOME%\server\bin;%JAVA_HOME%\bin;%PATH%;C:\oracle\ora92\bin;

The JDBC code I am using is

Connection con = null;
      Statement workStmt = null;
 try{
              
       Properties props = new Properties();
      props.put("user","BizAgiVision");
      props.put("password", "BizAgi");
      props.put("dll", "ocijdbc9");
      props.put("protocol", "oci9");
      
      Driver myDriver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
      
      DriverManager.registerDriver(myDriver);
      String connectionURL = "jdbc:oracle:oci9:@(description=(address=(host=devt_oracle)(protocol=tcp)(port=1521))(connect_data=(SID=BizAgiOr)))";
      
      con =    DriverManager.getConnection(connectionURL, props);

                Code continues..

UNFORTUNATELY, I AM GETTING THE EXCEPTION:

java.sql.SQLException: URL de Oracle especificada invßlida (TRANSLATED BY MYSELF AS: "specified URL for Oracle is not valid")
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:182)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at com.testing.session.stateless.FundsManagerStatelessBean.addFunds(Fund
sManagerStatelessBean.java:98)

DO YOU KNOW WHAT THE PROPER CONNECTION STRING WOULD BE FOR OCI9? this string worked in another machine but for
the OCI8 protocol.

Thanks.
0
Comment
Question by:eduardotorres17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 2000 total points
ID: 12022902
Umm.. I am using this one.

jdbc:oracle:thin:@(description=(address=(host=devt_oracle)(protocol=tcp)(port=1521))(connect_data=(sid=BizAgiOr)))
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question