Problem in connectString = "jdbc:oracle:oci8@";
i get error in following lines.
=========================================
connectString = "jdbc:oracle:oci8@";
connection = DriverManager.getConnectionconnectString,"ORDMEDIADEMO",
"ORDMEDIADEMO");
===========================================
what should be there in connection string??? after @ , anything is to be specified??
I wrote my computer name(win2000server)...(p4.headquarter.local) .but it diden/t work.......plz help me.
thanks
Look in the JDBC documentation.
What is your service name?
You can use a string like:
@(description=(address=(host=your_machine.your_domain.com)(protocol=tcp)(port=1521))(connect_data=(service_name=your_service.your_service_domain.com)))
Or you can use one of the definitions in your tnsnames.ora file @my_sid
Larry
Similar Messages
-
Problem in XI - JDBC (oracle) Scenario, case sensitive column name
I had a XI -> JDBC scenario, connecting to a SQL server, where the query was being generated using Message Mapping (XML SQL Format),
now the database has been migrated from SQL server to Oracle, and we are using the same XI scenario, but now the problem is, the query generated using message mapping doesnt work because it seems the query (UPDATE statement) requires the field name as having All capital letters, i mean the Column name in query to Oracle has become case sensitive,
can u help me outHi
Oracle doesnt have restriction that Query has to be in uppercase for any column. But it is good go use Upper case for the Query.
Use oracle editor to do the query if it is working fine and then use XML SQL in XI
Check this thread SAP has given some
http://help.sap.com/saphelp_nw04s/helpdata/en/43/68a541a1166153e10000000a1553f6/frameset.htm
Check FAQ on the JDBC adapter, see SAP Note 831162
always useful Note
Thanks
Gaurav -
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
I am getting below error when i m trying to access oracle db using oracle 11g client. It works with earlier oracle client versions. how do i resolve this. is there any issue with version of ojdbc6.jar that i am using??? I cant use thin driver since its an old application for which i dont have source files.
Apr 6, 2013 1:00:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at PettyCash.SysDate.getSysSubSys(SysDate.java:232)
at org.apache.jsp.PettyCash.index_jsp._jspService(org.apache.jsp.PettyCash.index_jsp:186)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Code is as follow for reference
import oracle.jdbc.driver.*;
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,db_user, db_pass);
eNVIRONMENT VARIABLES set are as follows:
classpath
C:\Program Files\apache-tomcat-5.5.12\common\lib\servlet-api.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\classes12.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\ojdbc6.jar;
JAVA_HOME
C:\Program Files\Java\jdk1.5.0_04
PATH
C:\Program Files\Java\jdk1.5.0_04\bin
ORACLE_HOME
D:\Oracle11\product\11.2.0\client_1\BINApr 8, 2013 5:24:06 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.abc.index_jsp._jspService(org.apache.jsp.abc.index_jsp:280)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595) -
Error at ODI With Oracle:OCI8
Hi to all, I have a problem with conection of ODI with a Oracle Rac 11g, my Oracle Client is a 10.2, the ODI (10.0.3) is on a Linux Red Hat Ent. and the java is a Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
So the Env, are Like this
# ODI
export ORACLE_BASE=/u01/oracle/product
export ORACLE_HOME=/u01/oracle/product/client/10.2
export ODI_JAVA_HOME=/u01/java/jdk/jdk/
export ODI_HOME=/u01/oracle/product/odi/10.1/oracledi
# Shared
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib:/u01/java/jdk/jdk/lib:/u01/oracle/product/odi/10.1/oracledi/lib:u01/oracle/product/client/10.2/lib
export PATH=.:/u01/java/jdk/jdk/bin:.:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/u01/oracle/product/odi/10.1/oracledi/binu01/oracle/product/client/10.2/bin
export CLASSPATH=.:/u01/java/jdk/jdk/lib:/u01/java/jdk/jdk/jre/lib:/u01/oracle/product/odi/10.1/oracledi/drivers
The tnsnames.ora is oks, because I can connect with sqlplus.
but when in ODI I use
oracle.jdbc.driver.OracleDriver
jdbc:oracle:oci8:@ServiceName
return me this error
java.lang.UnsatisfiedLinkError: oracle.jdbc.driver.T2CConnection.t2cGetCharSet([CI[CI[CI[CII[SLoracle/jdbc/driver/GetCharSetError;)S
at oracle.jdbc.driver.T2CConnection.t2cGetCharSet(Native Method)
do not connect, somebody knows how can I connect? Thanks for your help.
Edited by: user10860691 on 06/10/2009 22:07Very likely (see Metalink Note 788777.1) this is because the version of the JDBC driver and the OCI libraries is different.
Use the JDBC driver of the same version as the installed Oracle client libraries.
Yours,
Laurenz Albe -
How to set the oracle oci8 driver?
hello all:
I've set up the oracle thin driver and it works. but when I change to
oci8.it don't work
below is config and errors:
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="ocipool"
Properties="user=yanji;password=yanji"
Targets="myserver" URL="jdbc:oracle:oci8:@pg01"/>
Could not load 'oracle.jdbc.driver.OracleDriver
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
ectionEnvFactory.java:208)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource
ectionEnvFactory.java:131)
at weblogic.common.internal.ResourceAllocator.makeResources(Resource
ator.java:698)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocat
va:282)
best regardsHello, Jenny I am glad you found your resolution. I too am having problems isung
the oracle 0CI8 driver. My connection pool is creating fine, but my server is
crashing with JVM errors.
Here are my configurations.
DBase=Oracle 8.1.7,OS=Win2000, running 6.1 with Portal 4.0
pool config =
<JDBCConnectionPool CapacityIncrement="0"
DriverName="oracle.jdbc.driver.OracleDriver" InitialCapacity="5"
MaxCapacity="5" Name="ccConPool"
Properties="jdbc.url=jdbc:oracle:oci8:@servername:1521:orcl;user=XXXXX;password=XXXXXX;dll=ocijdbc8;server=orcl;protocol=oci8;dll=ocijdbc8;protocol=oci8"
RefreshMinutes="0" Targets="portalServer"
TestTableName="WIP_TABLE" URL="jdbc:oracle:oci8:@servername"/>
My classpath sets my classes12.zip file first. My path sets %WEBLOGIC_HOME%\bin\oci817_8
and %WLCS_ORACLE_HOME%\bin.
Am I setting the right dll and protocol in my .dll? Where can I find documentation
on these properties definitions?
"jenny" <[email protected]> wrote:
hello all:
I've got the answer. those all because weblogic.jar. this jar include
the
class "oracle.jdbc.driver.OracleDriver".
although I put the classes12.zip into the CLASSPATH.but the weblogic.jar
in
front of classes12.zip.so classloader
load the class from weblogic.jar. so I can use thin driver(weblogic
implements this function with class,but not for oci8 )
..this is really a big pitfall !
put the classes12.zip in front of weblogic.jar .all perfect!
"jenny" <[email protected]> wrote in message
news:[email protected]...
hello all:
below is some chapters of my config.xml and startWeblogic.cmd
the oci8 :
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="ocipool" Password="{3DES}J3XuQd6cvvw="
Properties="user=yanji;password=yanji;dll=ocijdbc8;protocol=oci8"
Targets="myserver" TestTableName="test"
URL="jdbc:oracle:oci8:@pg01"/>
the thin :
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="citcpool" Password="{3DES}J3XuQd6cvvw="
Properties="user=yanji;password=yanji"
SupportsLocalTransaction="true" Targets="myserver"
URL="jdbc:oracle:thin:@sune250:1521:pg01"/>
:runWebLogic
echo on
set ORACLE_HOME=e:\oracle
set PATH=./bin;%ORACLE_HOME%\bin;%ORACLE_HOME%\lib;%PATH%
set
CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\lib\dom.jar;.\lib\xml
4j.jar;.\lib\jecf.jar;%ORACLE_HOME%\jdbc\lib\classes12.zip
echo off
the thin driver is ok,but the oci driver can not work!
if I've set the wrong CLASSPATH or PATH , the thin driver and oci8driver
must have not worked. I confused!
"Sree Bodapati" <[email protected]> wrote in message
news:[email protected]...
"Sree Bodapati" <[email protected]> wrote in message
news:[email protected]...
Its not CLASS_PATH it should be CLASSPATH.
when you say oracle\bin and oracle\lib , on what driver is the oracle
folder?I meant to say 'on what drive' not 'on what driver'
you have to specify the full path.
post your startup script here.
sree
"jenny" <[email protected]> wrote in message
news:[email protected]...
hello all:
I've set the ORACLE_HOME,and CLASS_PATH,but nothing changed. I will
go
to
crazy!!!
when startup the weblogic,I've seen the oracle\bin and oracle\libin th
"path" and classes12.zip in the CLASS_PATH.but the errors stillappears!!
"Sree Bodapati" <[email protected]> wrote in message
news:[email protected]...
1. Dont copy this file oci8jdbc.dll, to bin folder. Make sure
you
place
<oracle_home>\lib in your PATH before starting the server. Make
sure
your
ORACLE_HOME environment varable is set to <oracle_home> folder.
eg. set ORACLE_HOME=c:\ora816 before starting the server.
so you must have done something like
set ORACLE_HOME=c:\ora816
set PATH=%ORACLE_HOME%\bin;%ORACLE_HOME%\lib;%PATH%
2. double check if you set your CLASSPATH something like this,
CLASSPATH=%ORACLE_HOME%\jdbc\lib\classes12.zip;%CLASSPATH%
in the server startup script just before starting the server.
3. start the server the connection pool should work.
hth
sree
"jenny" <[email protected]> wrote in message
news:[email protected]...
hello All:
I've edited the StartWeblogic.cmd, set the classes.zip into CLASSPATH,and
copied the oci8jdbc.dll to the bea\wlserver6.1\bin. errors stillappears!
my weblogic version is 6.1 and oracle is 8.1.6 .
why the thin driver is ok but the oci driver can not work?
I logined in the oracle website and look for the jdbc.but I find
that
jdbc
all provide for jdk1.2 or jdk1.1. because the weblogic6.1 based
jdk1.3.
I
think i can not use those drivers.
I think my oracle driver is ok,because i installed the jboss and
bas4.5
in
my computer. they all can use oci8 driver properly.and they all
based
jdk1.3.
by the way. I 've tryed added the oracle\bin path inStartWeblogic.cmd,
nothing changed !
again below is my config : I want to know whether my config right?
(the property DLL and Protocal auto added by the weblogic)
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="ocipool"
Properties="user=yanji;password=yanji;dll=ocijdbc8;protocol=oci8"
Targets="myserver" URL="jdbc:oracle:oci8:@pg01"/>
best regards
----- Original Message -----
From: "Mitesh Patel" <[email protected]>
Newsgroups: weblogic.developer.interest.jdbc
Sent: Thursday, December 13, 2001 4:00 AM
Subject: Re: how to set the oracle oci8 driver?
To use oracle oci8 driver:
You should have classes12.zip in weblogic classpath.
You should have ocijdbc8.dll in your weblogic path..
You can download ocijdbc8.dll from oracle website.
Mitesh Patel
jenny wrote:
hello all:
I've set up the oracle thin driver and it works. but when I
change
to
oci8.it don't work
below is config and errors:
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="ocipool"
Properties="user=yanji;password=yanji"
Targets="myserver" URL="jdbc:oracle:oci8:@pg01"/>
Could not load 'oracle.jdbc.driver.OracleDriver
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
atweblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection
ectionEnvFactory.java:208)
atweblogic.jdbc.common.internal.ConnectionEnvFactory.createResource
ectionEnvFactory.java:131)
atweblogic.common.internal.ResourceAllocator.makeResources(Resource
ator.java:698)
atweblogic.common.internal.ResourceAllocator.<init>(ResourceAllocat
va:282)
best regards
"jenny" <[email protected]> wrote in message
news:[email protected]...
hello all:
I've set up the oracle thin driver and it works. but when I change
to
oci8.it don't work
below is config and errors:
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="5" LoginDelaySeconds="5" MaxCapacity="15"
Name="ocipool"
Properties="user=yanji;password=yanji"
Targets="myserver" URL="jdbc:oracle:oci8:@pg01"/>
Could not load 'oracle.jdbc.driver.OracleDriver
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
atweblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection
ectionEnvFactory.java:208)
atweblogic.jdbc.common.internal.ConnectionEnvFactory.createResource
ectionEnvFactory.java:131)
atweblogic.common.internal.ResourceAllocator.makeResources(Resource
ator.java:698)
atweblogic.common.internal.ResourceAllocator.<init>(ResourceAllocat
va:282)
best regards -
I am using JBuilder5 which comes with jdk1.3. I have installed oracle 8.1.7 Enterprise version.
I am using Win NT 4.0.
I have set the PATH variable as E:\oracle\ora81\lib; and
CLASSPATH as : E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\jdbc\lib\nls_charset12.zip;
My JDBC code is
package sample2;
import java.sql.*;
public class Two {
Connection con;
Statement st;
public Two() {
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:oci8:@First","scott","tiger");
st = con.createStatement();
ResultSet rs = st.executeQuery("Select * from Book");
while(rs.next())
System.out.print(rs.getInt("ID")+"\t");
System.out.print(rs.getString("title")+"\t");
System.out.print(rs.getString("author")+"\t");
System.out.print(rs.getString("subject")+"\t");
System.out.println(rs.getInt("copies")+"\t");
st.close();
con.close();
catch(Exception ex)
System.out.println("Exception : " + ex.toString());
public static void main(String[] args) {
Two two1 = new Two();
I am getting this exception:
Exception : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I can understand that the classpath for the driver is the problem here.
Also, I tried to run this file without JBuilder as a independent file on a notepad. Even then this exception is thrown.
I have set the PATH to E:\oracle\ora81\bin and also to E:\oracle\ora81\lib.
I ran "echo %classpath%" from my command prompt and this is what i am getting.
E:\JBuilder5\jdk1.3\lib\tools.jar;E:\JBuilder5\jdk1.3\dt.jar;E:\oracle\ora81\jdbc\lib\classes12.zip;E:
\oracle\ora81\jdbc\lib\nls_charset12.zip;
I searched solution for this probldem in Sun JDC Forum itself. Many of them suggested to unzip classes12.zip and create jar file and add it in the classpath. Alos, some have suggested to copy the classes12.zip in home directory and then include this path in the classpath. I tried those solutions also. But, nothing seem to work.
Somebody help me fix this problem.
Thanks in advance.Jbuilder5 uses a different means of loading dependent classes. Use menu : Tools -->Configure Libraries - Click New and setup a new named library that points to classes12.zip .
Then include this in u'r required Libraries of your project using menu Project --> Project Properties - required Libraries tab.
I don't thnk Jbuilder5 even refers to CLASSPATH set in Windows NT environement. Path may need to be set to include oracle/ora81/bin directory though.
Hope this helps. -
WebLogic - How to Use Oracle OCI8 from NT?
Hi there,
I have set up WebLogic on NT. I have also installed Oracle client on
NT.
I want to connect to my Oracle database using OCI8 only. Can you
please tell me what I need to do to get this working on NT as I could
not get this to work?
My connection string is
jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(PORT=1527)(HOST=testserver)))(CONNECT_DATA=(SID=dbsid)))
What do I need to do to get WebLogic to recognise the driver (in
detail)?
Thanks in advance.
BBHi bob!
You have to use weblogic jDriver to connect to database using java application. You can create connectionpool as well as
datasource in weblogic and then get connection using:
ds.getConnection();
To create connections, you should have set following in your environment.
Path=.;ORACLE_HOME\bin;WEBLOGIC_HOME\bin\oci817_8
where ORACLE_HOME is where you installed oracle client and
WEBLOGIC_HOME is where you installed weblogic
After setting environemt, you can verify if environment is set or not by following command:
java utils.dbping oracle userid password databasename
Thanks,
Mitesh
bob brown wrote:
Hi there,
I have set up WebLogic on NT. I have also installed Oracle client on
NT.
I want to connect to my Oracle database using OCI8 only. Can you
please tell me what I need to do to get this working on NT as I could
not get this to work?
My connection string is
jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(PORT=1527)(HOST=testserver)))(CONNECT_DATA=(SID=dbsid)))
What do I need to do to get WebLogic to recognise the driver (in
detail)?
Thanks in advance.
BB -
Problem etablishing connection between oracle SQL and JDBC
Hi friends i have been trying this code from two days i donno whats wrong please try to sort the problem thank u in advance this is my program:
//This is my Connection class
package com.java.jdbc.util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class EmployeeUtil {
public EmployeeUtil()
public static Connection getconnection()
Connection con=null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORANT","system","manager");
// Class.forName("sun.jdbc.odbc.OracleDriver").newInstance();
// con = DriverManager.getConnection("jdbc:odbc:Javatut","System","manager");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return con;
//This is my DB class:
package com.java.jdbc.DB;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.java.jdbc.info.EmployeeInfo;
import com.java.jdbc.util.EmployeeUtil;
public class EmployeeDB {
Connection connection=null;
public EmployeeDB()
//this.connection=EmployeeUtil.getconnection();
public void select(EmployeeInfo empinfo)
this.connection=EmployeeUtil.getconnection();
String stb = "select * from employee";
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(stb);
System.out.println(rs);
//EmployeeInfo empinfo = new EmployeeInfo();
while(rs.next())
empinfo.setEmpId(rs.getString(1));
empinfo.setEmpfName(rs.getString(2));
empinfo.setEmplName(rs.getString(3));
empinfo.setEmpAge(rs.getString(4));
empinfo.setEmpSalary(rs.getString(5));
System.out.println("The EmployeeID is : "+empinfo.getEmpfName());
System.out.println("The Employee First Name is : "+empinfo.getEmpfName());
System.out.println("The Employee Last Name is : "+empinfo.getEmplName());
System.out.println("The Employee Age is : "+empinfo.getEmpAge());
System.out.println("The Employee Salary is : "+empinfo.getEmpSalary());
connection.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//This is my info object
package com.java.jdbc.info;
public class EmployeeInfo {
private String empId;
private String empfName;
private String emplName;
private String empAge;
private String empSalary;
public String getEmpAge() {
return empAge;
public void setEmpAge(String empAge) {
this.empAge = empAge;
public String getEmpfName() {
return empfName;
public void setEmpfName(String empfName) {
this.empfName = empfName;
public String getEmpId() {
return empId;
public void setEmpId(String empId) {
this.empId = empId;
public String getEmplName() {
return emplName;
public void setEmplName(String emplName) {
this.emplName = emplName;
public String getEmpSalary() {
return empSalary;
public void setEmpSalary(String empSalary) {
this.empSalary = empSalary;
//This is my Controller class:
package com.java.jdbc.controller;
import com.java.jdbc.DB.EmployeeDB;
import com.java.jdbc.info.EmployeeInfo;
public class EmployeeController {
public static void main(String args[])
EmployeeDB empdb = new EmployeeDB();
EmployeeInfo emp = new EmployeeInfo();
empdb.select(emp);
// I got these errors:
java.sql.SQLException: Io exception: Got minus one from a read call
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.java.jdbc.util.EmployeeUtil.getconnection(EmployeeUtil.java:18)
at com.java.jdbc.DB.EmployeeDB.select(EmployeeDB.java:20)
at com.java.jdbc.controller.EmployeeController.main(EmployeeController.java:11)
Exception in thread "main" java.lang.NullPointerException
at com.java.jdbc.DB.EmployeeDB.select(EmployeeDB.java:23)
at com.java.jdbc.controller.EmployeeController.main(EmployeeController.java:11)Are you using Oracle 10.2 in shared server configuration under Windows?
If so it's a driver bug (BUG - Connection pooling with 10g 10.1.3 Preview 4 App Server Oracle suggest to use OCI driver. -
Problem with connect to oracle by jdbc
hi,
First time i try to connect to the oracle db 10.2.0* EE in java and its problem. I use eclipse 3.4, jre1.5.0_17, driver ojdbc14.jar (dedicated to this oracle ver and jre).
package connect;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class JDBC_Conn {
void polaczenie_z_baza() throws SQLException {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("connected");
} catch (Exception e) {
System.out.println("not connected");
Connection polaczenie=DriverManager.getConnection("jdbc:oracle:thin:@3.123.123.321:1521:RI3","user","pass");
public static void main(String[] args){
JDBC_Conn b = new JDBC_Conn();
try {
b.polaczenie_z_baza();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}and after run in console i see: "connected" but after 2 seconds i see error:
java.sql.SQLException: Wyjątek we-wy: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at connect.JDBC_Conn.polaczenie_z_baza(JDBC_Conn.java:18)
at connect.JDBC_Conn.main(JDBC_Conn.java:24)This is important that i can login to the database by pl/sql developer using tnsnames.ora like this:
CIF2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 3.123.123.321)(PORT = 1521))
(CONNECT_DATA =
(SID = RI3)
)but when im logging by plsql developer i need to enter the name of database "DWH" too, another i cant login. The same when i log by sql plus, i need to enter the: user@DWH.
So please tell me could i add to this string:
"jdbc:oracle:thin:@3.123.123.321:1521:RI3","user","pass"
the DWH database? where i should to put it?
i try a lot of cases and cant login
thanks for helpi put:
String url = "jdbc:oracle:thin:"+user+"/"+pass+"@blahblahblah:blah:blah";
System.out.println( url );
Connection con = DriverManager.getConnection( url );and i have:
not connected
jdbc:oracle:thin:user/password@blahblahblah:blah:blah
java.sql.SQLException: Wyjątek we-wy: Invalid number format for port number
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at connect.JDBC_Conn.polaczenie_z_baza(JDBC_Conn.java:27)
at connect.JDBC_Conn.main(JDBC_Conn.java:37)the pass and user name i put corectly..
is it possible that DBA did some restrict to access DB?
Edited by: pawelwtorek on 2009-03-19 16:59 -
JDBC - Oracle 8.1.7 Connection Problem
Hi,
Things were working great as long as i was with Oracle 8.1.6. All hell broke loose as soon as i tried to connect to Oracle 8.1.7. Only the IP, Service name, DB_Id & Db_Pass has changed in the connection string. Yet on the below statement
DriverManager.getConnection("jdbc:oracle:thin:@192.168.172.34:1521:epcjobs","epcperf","epcperf");
i get the following exception
java.sql.SQLException: Protocol violation
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:391)
at oracle.jdbc.ttc7.O3log.receive2nd(O3log.java:651)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:172)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:103)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:148)
Seems some problem in the protocol or sub-protocol name or do i have to change my Oracle Drivers?
If any one has encountered this issue, please enlighten me.
Note: I can connect successfully using SQL+.
many thanks in advance,
PawanJust a guess...
The Oracle comm processes (net8 or whatever it is called) allows for different protocols to communicate. Your server is set up for a different protocol than the old one was. Either the client or the server needs to adjust.
You can test this by creating a TSN and using sqlplus to connect. Once it works open up the TSN file (*.ora?) and get the correct params from there. -
Hi all
When I try to make connection through this string jdbc:oracle:thin:@localhost:1521:orcl , It failed to connect to the database.
I am trying to connect to database through obiee 11.1.1.5 by jdbc connectivity.
Please tell me its solution.....
Thanks
Rizwan AliHi,
The TNSNAME.ora that the OBIEE11g uses is insede the folder <OBIEE11g_HOME>\Middleware_Home\Oracle_BI1\network\admin
(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = IP address)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
Refer
http://123obi.com/2011/03/error-the-connection-has-failed-in-obiee-11g/
http://gerardnico.com/wiki/database/oracle/connect_descriptor
FYI: OTN Message:
1. If you just need one TNS alias, then copy the database connection descriptor from database tnsnames.ora file to the tnsnames.ora file under the BIEE directory:
[middleware home]/[oracle home]/Oracle_BI1/network/admin
2. You may also copy the entire tnsnames.ora file
3. Another alternative is to set the TNS_ADMIN environment varaible which would point to the directory where a tnsnames.ora file is located. This would need to be set as a System Environment variable in Windows or in the command shell if starting from a command-line. For Unix/Linux, it would need to configured in the user profile that owns the software or set explicitly in the shell if starting from the command-line. See Note 111942.1 Setting TNS_ADMIN Environment Variable for more information on adding this environment variable.
Thanks
Deva -
Problem in getting jdbc connection with oracle for win 98
This is my code given below
import java.sql.*;
public class Oconnection
Connection conn;
Statement st;
PreparedStatement pst,pstissue,pstret,pstbook;
public Oconnection()
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","manager");
catch(Exception ex)
System.out.println(ex.getMessage());
ex.printStackTrace();
public static void main(String args[])
new Oconnection();
*****************************************************8
Error
C:\Library>java Oconnection
Io exception: The Network Adapter could not establish the connection
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at Oconnection.<init>(Oconnection.java:17)
at Oconnection.main(Oconnection.java:39)
I am using Oracle for win95 or i think it is oarcleforwin98 .
The sid of my database i found through query given was orcl, what changes should i do in the code so that it works.
should i use another driver coz i am using latest driver from oracle.com which is for oracle 8i. if a need a driver change where can i download it from please help mehttp://forum.java.sun.com/thread.jsp?thread=291584&forum=48&message=1305045
-
Problem with Unicode and Oracle NCLOB fields
When I try to INSERT a new (N)CLOB into an Oracle database, all is fine until I use a non-ASCII character, such as an accented roman letter, like the "�" (that's '\u00E9') in "caf�" or the Euro Currency symbol "?" (that's '\u20AC' as a Java character literal, just in case the display is corrupted here too). This doesn't happen with "setString", but does happen when streaming characters to the CLOB; however, as Oracle or the driver refuse strings larger than 4000 characters, and as I need to support all the above symbols (and many more), I'm stuck.
Here's the background to the problem (I've tried to be detailed, after a lot of looking around on the web, I've seen lots of people with similar problems, but no solutions: I've seen and been able to stream ASCII clobs, or add small NCHAR strings, but not stream NCLOBs...).
I'm using Oracle 9.2.0.1.0 with the "thin" JDBC driver, on a Windows box (XP Pro). My database instance is set up with AL32UTF8 as the database encoding, and UTF8 as the national character set.. I've created a simple user/schema, called LOBTEST, in which I created two tables (see below).
The basic problems are :
- with Oracle and JDBC, you can't set the value of a CLOB or NCLOB with PreparedStatement's setString or setCharacterStream methods (as it throws an exception when you send more than 4000 characters)
- with Oracle, you can only have one LONG VARCHAR-type field per table (according to their documentation) and you MUST read all columns in a set order (amongst other limitations).
- with a SQL INSERT command, there's no way to set the value of a parameter that's a CLOB (implementations of the CLOB interface can only be obtained by performing a SELECT.... but obviously, when I'm inserting, the record doesn't exist yet...). Workarounds include (possibly) JDBC 4 (doesn't exist yet...) or doing the following Oracle-specific stuff :
INSERT INTO MyTable (theID,theCLOB) VALUES (1, empty_clob());
SELECT * FROM MyTable WHERE theId = 1;
...and getting the empty CLOB back (via a ResultSet), and populating it. I have a very large application, that's deployed for many of our customers using SapDB and MySQL without a hitch, with "one-step" INSERTS; I can't feasibly change the application into "three-step INSERT-SELECT-UPDATE" just for Oracle, and I shouldn't need to!!!
The final workaround is to use Oracle-specific classes, described in:
http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/index.html
...such as CLOB (see my example). This works fine until I add some non-ASCII characters, at which point, irrespective of whether the CLOB data is 2 characters or 2 million characters, it throws the same exception:
java.io.IOException: Il n'y a plus de donn?es ? lire dans le socket
at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:204)
at scratchpad.InsertOracleClobExample.main(InsertOracleClobExample.java:61)...where the error message in English is "No more data to read from socket". I need the Oracle-specific "setFormOfUse" method to force it to correctly use the encoding of the NCLOB field, without it, even plain ASCII data is rejected with an exception indicating that the character set is inappropriate. With a plain CLOB, I don't need it, but the plain CLOB refuses my non-ASCII data anyway.
So, many many thanks in advance for any advice. The remainder of my post includes my code example and a simple SQL script to create the table(s). You can mess around with the source code to test various combinations.
Thanks,
Chris B.
CREATE TABLE NCLOBTEST (
ID INTEGER NOT NULL,
SOMESTRING NCLOB,
PRIMARY KEY (ID)
CREATE TABLE CLOBTEST (
ID INTEGER NOT NULL,
SOMESTRING CLOB,
PRIMARY KEY (ID)
package scratchpad;
import java.io.Writer;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import oracle.jdbc.driver.OracleDriver;
import oracle.jdbc.driver.OraclePreparedStatement;
import oracle.sql.CLOB;
public class InsertOracleClobExample
public static void main(String[] args)
Properties jdbcProperties = new Properties();
jdbcProperties.setProperty( "user", "LOBTEST" );
jdbcProperties.setProperty( "password", "LOBTEST" );
// jdbcProperties.setProperty("oracle.jdbc.defaultNChar","true");
Driver jdbcDriver = new OracleDriver();
PreparedStatement pstmt = null;
Connection connection = null;
String tableName = "NCLOBTEST";
CLOB clob = null;
try
connection = jdbcDriver.connect("jdbc:oracle:thin:@terre:1521:orcl", jdbcProperties);
pstmt = connection.prepareStatement("DELETE FROM NCLOBTEST");
pstmt.executeUpdate();
pstmt.close();
pstmt = connection.prepareStatement(
"INSERT INTO "+tableName+" (ID,SOMESTRING) VALUES (?,?);"
clob = CLOB.createTemporary(pstmt.getConnection(), true, CLOB.DURATION_SESSION);
clob.open(CLOB.MODE_READWRITE);
Writer clobWriter = clob.getCharacterOutputStream();
clobWriter.write("Caf? 4,90? TTC");
clobWriter.flush();
clobWriter.close();
clob.close();
OraclePreparedStatement opstmt = (OraclePreparedStatement)pstmt;
opstmt.setInt(1,1);
opstmt.setFormOfUse(2, OraclePreparedStatement.FORM_NCHAR);
opstmt.setCLOB(2, clob);
System.err.println("Rows affected: "+opstmt.executeUpdate());
catch (Exception sqlex)
sqlex.printStackTrace();
try {
clob.freeTemporary();
} catch (SQLException e) {
System.err.println("Cannot free temporary CLOB: "+e.getMessage());
try { pstmt.close(); } catch(SQLException sqlex) {}
try { connection.close(); } catch(SQLException sqlex) {}
}The solution to this is to use a third-party driver. Oranxo works really well.
- Chris -
How to specify JDBC Oracle url using deployment tool - Entity Bean
Hello I'am new to EJB.
When creating a entity bean-managed persistence and you need to specify the jdbc url with user name
and password to establish a connection object, how does one specify that in the deployment
tool?
Heres an example of what has in the J2EE tutorial has in AccountEJB to get an connection object
private String dbName = "java:comp/env/jdbc/AccountDB";
private void makeConnection() throws NamingException, SQLException {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
con = ds.getConnection();
Now if my oracle jdbc url is to be jdbc:oracle:thin:@Abe:1521:dev
ie My host is Abe, port number 1521 and database name of dev and username/password will be system/manager.
what would my dbName be at the top?
Would my JNDI lookup of a DataSource resource "java:comp/env/jdbc/AccountDB" become "java:comp/env/jdbc/dev" for starters?
In the Resource Factories Reference Code I've add a reference of
Coded Name: jdbc/dev
Type: javax.sql.DataSource
Authentication: Container
and down the bottom of the I've put JNDI Name: MyAccount
according to the AccountClient code of:
Context initial = new InitialContext();
Object objref = initial.lookup("MyAccount");
and put User Name of "system" and Password of "manager"
I'am sure in the source code I have to put
Class.forName("oracle.jdbc.driver.OracleDriver")
else you would get that no sutitable driver error, maybe you don't have to if ejb server is smart enough?
What I'am confuse about is where to specify the jdbc url of "jdbc:oracle:thin:@Abe:1521:dev" ??
Know it won't work because of this vital part. Do you have to put that somewhere else in the deployment tool or properties file, or some other tool??
Please help
Thanks
Abraham KhalilWhen running the client after successful deployment with jdbc, I'am getting
javax.naming.CommunicationException: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:923)
at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:281)
at com.sun.corba.ee.internal.corba.TCUtility.unmarshalIn(TCUtility.java:274)
at com.sun.corba.ee.internal.corba.AnyImpl.read_value(AnyImpl.java:554)
at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:605)
at com.sun.corba.ee.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:252)
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.readAny(Util.java:203)
at javax.rmi.CORBA.Util.readAny(Unknown Source)
at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.lookup(Unknown Source)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:133)
at javax.naming.InitialContext.lookup(Unknown Source)
at AccountClient.main(AccountClient.java:21)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:151)
at javax.naming.InitialContext.lookup(Unknown Source)
at AccountClient.main(AccountClient.java:21)
One thing I don't like about EJB is that everything is transparent which is good! But its much
harder to debug! :( Tried to see if I can figure it out. Hope someone has seen this problem before? -
Error when using jdbc:oracle:kprb:
Hi folks!
I'm having a hard time trying to solve this one, here's the situation:
I've developed a java stored procedure and ulpoaded to the database using loadjava, which gave me no problems.
Then i've set permissions for the procedure:
BEGIN
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:java.io.FilePermission',
permission_name => '/home/xmlgate/inbound/*',
permission_action => 'read');
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:java.io.FilePermission',
permission_name => '/home/xmlgate/outbound',
permission_action => 'write');
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:java.lang.RuntimePermission',
permission_name => 'setFactory',
permission_action => '');
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:oracle.aurora.security.JServerPermission',
permission_name => 'Debug',
permission_action => '');
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:oracle.aurora.security.JServerPermission',
permission_name => 'LoadClassInPackage.oracle.sql.*',
permission_action => '');
dbms_java.grant_permission(
grantee => 'XMLADMIN',
permission_type => 'SYS:oracle.aurora.security.JServerPermission',
permission_name => 'LoadClassInPackage.oracle.jdbc.*',
permission_action => '');
COMMIT;
END;
But when i run the code inside the databse it always gives java.lang.NullPointerException.
Here's the main class:
package packupload;
import java.sql.*;
import java.util.*;
import oracle.jdbc.driver.*;
public class connection {
// Return a JDBC Connection appropriately either outside or inside Oracle8i
public static Connection getConnection() throws SQLException {
String username = "xmladmin";
String password = "xxxxxxxx";
String thinConn = "jdbc:oracle:thin:@192.168.xxx.xxx:1521:www";
String default8iConn = "jdbc:oracle:kprb:";
Connection cn = null;
try {
// Register the JDBC Driver
Driver d = new oracle.jdbc.driver.OracleDriver();
//Connect with Native (kprb) Driver if inside Oracle8i
if (insideOracle8i())
cn = DriverManager.getConnection(default8iConn);
else
cn = DriverManager.getConnection(thinConn,username,password);
cn.setAutoCommit(false);
return cn;
} catch (Exception e) { throw new SQLException("Error Loading JDBC Driver" + insideOracle8i());
public static boolean insideOracle8i() {
// If oracle.server.version is non-null, we're running in the database
String ver = System.getProperty("oracle.server.version");
return (ver != null && !ver.equals(""));
Any help would be greatly aprecciated.
Pedro SilvaHi..
I did it but here i am wondering becoz my RFC connection SAPSLDAPI works fine
But at transaction SLDCHECK..it throws an error like
Calling function LCR_LIST_BUSINESS_SYSTEMS
Retrieving data from the SLD server...
Function call returned exception code 4
=> Check whether the SLD is running!
Summary: Connection to SLD does not work
=> Check SLD function and configurations
But the SLD URL pops up and opens wih put any error.in a same fashion,it happens in SXMB_ADM--> integration engine config.it says connections to SLD doesnot work
any idea to verify
Thanks
Gopal
Maybe you are looking for
-
Help needed with audio files in pdf
I added mp3 audio files to a multi page pdf document via Acrobat Pro and the files play fine for me when I open the pdf. My client, however, doesn't even see the audio player rectangles after opening the pdf. Is there something I'm missing to make th
-
I am running iTunes 7.7 (on 10.5.4) - when i try and open the iTunes store, iTunes quits without an error message. Can anyone advise on how to solve this?
-
Facebook Greetings for All Toshiba Users
Hey everyone, I just wanted to advertise for all Toshiba users, fanpage on fb which is created by one of the authorized service. We will try to answer on all of your question, fix a parts for you if it will be needed or extend your warranty :) Check
-
Using Custom Attributes in HBR
<p>Does anyone know how to use custom attributes to limit local orglobal HBR variables (run-time prompts)? We have business rulesthat were developed in the graphical designers and the run timeprompt was set up to limit the user's selection based on a
-
I have Oracle 10g and a scheduled job which executes a hot backup every day at 2 AM. Yesterday evening at 10 PM the listener hung. I rebooted the machine this morning and everything is fine now. However, the Jobs page shows, that the last backup has