Window2000+Resin+Oracle JDBC OCI 8.17
as title
Hi,dear all:
I am a fresh man in Oracle JDBC Driver.
I can`t connect to my Oracle Database
and error message is following:
cannot resolve symbol
symbol : class OracleDriver
location: package driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
^
1 error
does anybody help me???
please.... I am so confused.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by (gionix):
Hi
I have a problem with oci 8 driver, when i create a connection, if i use the oracle jdbc thin driver it work, but if i tried to use de oci 8 i get the error message: "no ocijdbc8.dll in java.library.path" when i test the connection. I read the jdbc user guide and verify the installation, all zip and dll files are locate in the correct directory, i set the classpat and path to the correct value but it does'nt work.
Thanks
Gioni<HR></BLOCKQUOTE>
Add your ora bin to the JLP and SLP paths in JDeveloper.ini. It is D:\Ora81\bin on my system.
Example
JLP=-Djava.library.path=.;(.paths here.);D:\Ora81\bin
null
Similar Messages
-
Oracle JDBC OCI doesn't work on Linux
Hi,
I'm using Oracle on Linux(RH6, kernel 2.2.13)
Oracle works fine.
JDBC Thin driver -OK!
But java receives SIGSEV when I'm using JDBC OCI. More specific, it seems to be a problem with the so library associated to this driver, cause this SIGSEV happens in a native method.
Help?Have you posted this question to the JDBC/SQLJ Users group on Technet.
This is a JSP users group. -
Failed to call Oracle JDBC OCI driver
Hi - there,
I have just loaded JDBC classes for Oracle 8.0.5, which is running on Sun Solaris.
The Path setup for this driver is
CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip
LIBRARY_PATH=$ORACLE_HOME/jdbc/lib:$ORACLE_HOME/lib.
But I am not able to run any test programs and keep getting the error of
"java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
Someone can help me to jump-start this driver?
Thank a lot
CharlieTry to use Backslashes in the classpath.
It is a problem of your Classpath, because it don't find the class.
Regards,
Geri -
8.1.6 Oracle JDBC-OCI for NT availability
Hi. Does anyone know when the 8.1.6 JDBC-OCI driver for NT is coming out? I've read on previous posts that it will use JNI version older than NMI so it will work with development tools like Visual Age and with MS VM. It will be JDK 1.2.x compliant.
If anyone knows when it comes out, please post. The Solaris version has been out for a while now.
Thanks in advance.I head that the NT 8.1.6 release was delayed a bit more, possibly until March 2000 time frame.
-
Problem with ORACLE JDBC OCI-8 Driver
Hi All,
I'm still having problems with this driver. JDev is aware of my Oracle home, so I assume it's throwing the oraclehome/bin directory which contains the ocijdbc8.dll file into the path when it runs the connection manager.
I tried running my test program on the command line and I get
java.sql.SQLException: ►P⌡ -
` O R A - 0 6 4 0 1 : N E T C M N : i n v a l i d d r i v e r d e s
i g n a t o r
I have Oracle Client 8.1.5 installed and I'm using the Oracle 8.1.6 JDBC drivers that came with JDev on JDK 1.1.8
Thanks for any help,
Rich
nullWell, I realized I wasn't using the TNSNAME for my db when I switched over from the thin client to the thick client. That solved my problem when running from the command line.
But my ConnectionManager test connection in JDev still refuses to find the ocijdbc8.dll
Rich -
How to use the Oracle 10g JDBC OCI driver in JBoss ?
Greetings,
I deployed ojdbc14.jar in JBoss and I created an Oracle datasource. I have the following questions:
1. In the datasource descriptor file I have:
<connection-url>jdbc:oracle:oci:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=xe)))</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
Is it enough in order to use the Oracle 10g JDBC OCI driver ?
2. After having looked-up the datasource and created a connection, the classe of these objects are org.jboss.resource.adapter.jdbc.WrapperDataSource and, respectivelly, org.jboss.resource.adapter.jdbc.WrappedConnection. How can I have access to oracle.jdbc.oci and oracle.jdbc.pool packages ?
Many thanks in advance,
NicolasHello
We were banging our heads on a similar thing, maybe this will help
We needed to convert the wrapped connection to an OracleConnection so that we could do a proxy switch, but maybe you could apply it to your situation anyway
1-you have to convert the Connection object to an OracleConnection in order to use the method that does the proxy switch
The method to do this is getInnermostDelegate()
Once you call this method, you get a new Connection object that can be cast to an OracleConnection object
See below for the snippet of code
// now switch the user and reselect
if (conn instanceof DelegatingConnection) {
properties.put("PROXY_USER_NAME","peter/peter");
oraConn =((DelegatingConnection)conn).getInnermostDelegate();
if (oraConn == null)
out.println("oraConn is null\n");
((OracleConnection)oraConn).openProxySession(OracleConnection.PROXYTYPE_USER_NAME,properties);
2-you have to put a setting in the xml file in conf/Catalina/localhost that allows you to call the getInnermostDelegate() method
By default, Tomcat does not allow you to call this method, it will always return null
You have to change the xml to allow it to return an object
It seems that WebSphere and Tomcat both frown on vendor-specific methods that do not comply with the JDBC standards, but do allow it
Here is the setting:
<parameter>
<!-- NOTE: This is necessary to enable access to the Oracle connection object -->
<name>accessToUnderlyingConnectionAllowed</name>
<value>true</value>
</parameter>
Note, this setting was also put in the conf/server.xml file
Thanks
Peter -
Differences between Oracle JDBC Thin and Thick Drivers
If any body is looking for this information...
============================================================
I have a question concerning the Oracle JDBC thin vs. thick drivers
and how they might affect operations from an application perspective.
We're in a Solais 8/Oracle 8.1.7.2 environment. We have several
applications on several servers connecting to the Oracle database.
For redundancy, we're looking into setting up TAF (transparent
application failover). Currently, some of our apps use the Oracle
<B>JDBC thin</B> drivers to talk to the database, with a connection
string that like this:
<B> jdbc:oracle:thin:@host:port:ORACLE_SID </B>
In a disaster recovery mode, where we would switch the database
from one server to another, the host name in the above string
would become invalid. That means we have to shut down our application
servers and restart them with an updated string.
Using the Oracle <B>OCI (thick)</B> driver though, allows us to connect
to a Net8 service instead of a specific server:
<B> jdbc:oracle:oci8:@NET8_SERVICE_NAME </B>
Coupled with the FAILOVER=ON option configured in Net8, it is
then possible to direct a connection from the first server to
the failover database on another server. This is exactly what
we would like to do.
My question is, from an application perspective, how is the Oracle
thick driver different from the thin driver? If everything
else is "equal" (i.e. the thick driver is compatible with the
app servers) would there be something within the the thick/OCI
driver that could limit functionality vs. the thin driver?
My understand, which obviously is sketchy, is that the thick
driver is a superset of the thin driver. If this is the case,
and for example if all database connections were handled through
a configuration file with the above OCI connection string, then
theoretically the thick driver should work.
============================================================
<B>
In the case with the Oracle, they provide a thin driver that is a 100% Java driver for client-side use without the need of an Oracle installation (maybe that's why we need to input server name and port number of the database server). This is platform indipendent, and has good performance and some features.
The OCI driver on the other hand is not java, require Oracle installation, platform dependent, performance is faster, and has a complete list of all the features.
</B>
========================================================
I hope this is what you expect.
JDBC OCI client-side driver: This is a JDBC Type 2 driver that uses Java native methods to call entrypoints in an underlying C library. That C library, called OCI (Oracle Call Interface), interacts with an Oracle database. <B>The JDBC OCI driver requires an Oracle (7.3.4 or above) client installation (including SQL*Net v2.3 or above) and all other dependent files.</B> The use of native methods makes the JDBC OCI driver platform specific. Oracle supports Solaris, Windows, and many other platforms. This means that the Oracle JDBC OCI driver is not appropriate for Java applets, because it depends on a C library to be preinstalled.
JDBC Thin client-side driver: This is a JDBC Type 4 driver that uses Java to connect directly to Oracle. It emulates Oracle's SQL*Net Net8 and TTC adapters using its own TCP/IP based Java socket implementation. <B>The JDBC Thin driver does not require Oracle client software to be installed, but does require the server to be configured with a TCP/IP listener. Because it is written entirely in Java, this driver is platform-independent.</B> The JDBC Thin driver can be downloaded into any browser as part of a Java application. (Note that if running in a client browser, that browser must allow the applet to open a Java socket connection back to the server.
JDBC Thin server-side driver: This is another JDBC Type 4 driver that uses Java to connect directly to Oracle. This driver is used internally by the JServer within the Oracle server. This driver offers the same functionality as the client-side JDBC Thin driver (above), but runs inside an Oracle database and is used to access remote databases. Because it is written entirely in Java, this driver is platform-independent. There is no difference in your code between using the Thin driver from a client application or from inside a server.
======================================================
How does one connect with the JDBC Thin Driver?
The the JDBC thin driver provides the only way to access Oracle from the Web (applets). It is smaller and faster than the OCI drivers, and doesn't require a pre-installed version of the JDBC drivers.
import java.sql.*;
class dbAccess {
public static void main (String args []) throws SQLException
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@qit-uq-cbiw:1526:orcl", "scott", "tiger");
// @machineName:port:SID, userid, password
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
while (rset.next())
System.out.println (rset.getString(1)); // Print col 1
stmt.close();
How does one connect with the JDBC OCI Driver?
One must have Net8 (SQL*Net) installed and working before attempting to use one of the OCI drivers.
import java.sql.*;
class dbAccess {
public static void main (String args []) throws SQLException
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
Connection conn = DriverManager.getConnection
("jdbc:oracle:oci8:@qit-uq-cbiw_orcl", "scott", "tiger");
// or oci7 @TNSNames_Entry, userid, password
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
while (rset.next())
System.out.println (rset.getString(1)); // Print col 1
stmt.close();
=================================================================Wow, not sure what your question was, but there sure was a lot of information there...
There really is only one case where failover occurs, and it would not normally be in a disaster recovery situation, where you define disaster recovery as the obliteration of your current server farm, network and concievably the operational support staff. This would require a rebuild of your server, network etc and isn't something done with software.
Fail over is normally used for high availablity that would take over in case of hardware server failure, or when your support staff wants to do maintenance on the primary server.
Using the thin and thick driver should have ZERO affect on a failover. Transparent failover will make the secondary server the same IP as the primary, therefore the hostname will still point to the appropriate server. If you are doing this wrong, then you will have to point all your applications to a new IP address. This should be something that you tell your management is UNACCEPTABLE in a fail-over situation, since it is almost sure to fail to fail-over.
You point out that you are providing the TNSNAME, rather than the HOSTNAME when using the thick driver. That's true within your application, but that name is resolved to either a HOSTNAME, or IP ADDRESS before it is sent to the appropriate Oracle server/instance. It is resolved using either a NAME server (same as DNS server but for Oracle), or by looking at a TNSNAMES file. Since the TNSNAMES files profilerate like rabbits within an organization you don't want a fail over that will make you find and switch all the entries, so you must come up with a fail over that does not require it.
So, the application should not be concerned with either the hostname, or the IP address changing during fail over. That makes use of the thin or thick client acceptable for fail over.
Don't know if this will help, but this shows the communication points.
THIN DRIVER
client --> dns --> server/port --> SID
THICK DRIVER
client --> names server --> dns --> server/port --> SID
client --> tnsnames --> dns --> server/port --> SID -
Oracle Jdbc Thin driver and nls suppot
Hello,
I have a hungarian database with nls_lang variable set to hungarian. I'm trying to do a jdbc connection using classes12.zip
but I'm getting the hungarian characters converted to question marks or other characters.
I read suggestions that I must include the nls_charset12.zip in my classpath too. So I did that but I'm still having the same problem.
What is missed??
How do I get the right hungarian charachters without any conversion.
This is becoming frustrating and I'm not able to solve it yet.
Thanks for your helpOne more question -
Can we use Oracle JDBC OCI driver? We do not have any appletes...
Does it have firewall issues too? Is there any other driver that
we can use?
Thanks,
Vijaya. -
Oracle JDBC Thin Driver and Firewall Problem
Hi!
We have Oracle 8.1.5 and Websphere App Server. There is a
firewall between the two. A servlet creates a connection pool
(not that of Wesphere's). The frontend is JSP/HTML (no applets).
The servlet uses the Oracle JDBC Thin Driver for DB Connections.
The problem is - Once the connection is freed, the connection
pool is not being able to retrieve it and hence it created
another one, thus reaching the max. # of connections and the
system hangs. Restarting the DB service flushes the connection
and the application starts running again...
There was a similar problem discussed in this forums long ago. I
have not yet tried mentioning the firwall port and IP in the
connection string. But apart from that, is there any other
setting I need to do (on firewall or for the connectionstring)
to deal with this problem?
Someone had suggested to punch a hole in the firewall for the DB
port - but we can not really do that in the current scenario...
I would appreciate if anyone could share their experience
regarding how they resolved this issue.
Thanks in advance,
Vijaya.One more question -
Can we use Oracle JDBC OCI driver? We do not have any appletes...
Does it have firewall issues too? Is there any other driver that
we can use?
Thanks,
Vijaya. -
Execution of first request takes lot of time with JDBC OCI
Hi,
We are having an application which connects to Oracle server(10g Enterprise Edition Release 10.2.0.4.0 64bit) using Oracle JDBC OCI driver(10.2.0.1.0 production (10g R2)).
Everything works fine.
But what we observed is randomly the first request to the server vai JDBC driver in a day takes lot of time, varies from 5-15 minutes.
If we execute the request again it executed immediately
What we observed while debugging is preparedStatement.executeQuery() is taking time.
We enabled logging at the JDBC driver layer and a snapshot isgiven below. Between T2CPreparedStatement.doDefineExecuteFetch () and T2CPreparedStatement.execute_for_rows () it takes 5 minutes. Any idea why it takes this much time and reason for it? Oracle driver is not throwing any exceptions
*4-apr-2011 4:00:01* oracle.jdbc.driver.T2CPreparedStatement doDefineExecuteFetch
FINE: T2CPreparedStatement.doDefineExecuteFetch ()
*4-apr-2011 4:05:12* oracle.jdbc.driver.T2CPreparedStatement executeForRows
FINE: T2CPreparedStatement.execute_for_rows () returns: void
Detailed jdbc log is below
-apr-2011 4:00:01 oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout() needToPrepareDefineBuffer = false
4-apr-2011 4:00:01 oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
4-apr-2011 4:00:01 oracle.jdbc.driver.PhysicalConnection registerHeartbeat
FINE: PhysicalConnection.registerHeartbeat()
4-apr-2011 4:00:01 oracle.jdbc.driver.OracleStatement executeMaybeDescribe
FINE: OracleStatement.execute_maybe_describe() rowPrefetchChanged = false, needToParse = false, needToPrepareDefineBuffer = false, columnsDefinedByUser = false
4-apr-2011 4:00:01 oracle.jdbc.driver.T2CPreparedStatement executeForRows
FINE: T2CPreparedStatement.execute_for_rows (executed_for_describe = false)
4-apr-2011 4:00:01 oracle.jdbc.driver.T2CPreparedStatement doDefineExecuteFetch
FINE: T2CPreparedStatement.doDefineExecuteFetch ()
4-apr-2011 4:05:12 oracle.jdbc.driver.T2CPreparedStatement executeForRows
FINE: T2CPreparedStatement.execute_for_rows () returns: void
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleStatement executeMaybeDescribe
FINE: OracleStatement.execute_maybe_describe():return validRows = 1, needToPrepareDefineBuffer = false
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
FINE: OracleStatement.doExecuteWithTimeout():return validRows = 1, needToPrepareDefineBuffer = false
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl next
FINE: OracleResultSetImpl.next(): closed=false
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl next
FINER: closed=false, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl getString
INFO: OracleResultSetImpl.getString(columnIndex=1)
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl getString
INFO: OracleResultSetImpl.getString(columnIndex=2)
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl getString
INFO: OracleResultSetImpl.getString(columnIndex=3)
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl getTimestamp
INFO: OracleResultSetImpl.getTimestamp(columnIndex=4)
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl wasNull
INFO: OracleResultSetImpl.wasNull()
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl next
FINE: OracleResultSetImpl.next(): closed=false
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl next
FINER: closed=false, statement.currentRow=0, statement.totalRowsVisited=1, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
4-apr-2011 4:05:12 oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
4-apr-2011 4:05:12 oracle.jdbc.driver.T2CPreparedStatement closeQuery
FINE: T2CPreparedStatement.closeQuery ()
4-apr-2011 4:05:12 oracle.jdbc.driver.T2CPreparedStatement closeQuery
FINE: T2CPreparedStatement.closeQuery () returns: void
4-apr-2011 4:05:12 oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()
Regards
SunilHi,
Thanks for the reply
- SQL may vary. Its not the same query which takes time always. The same query executed immediately(using another connection from pool) works perfectly
- If there is a failover or stale connection getting closed or timeout, will JDBC driver thhrows exdeption? I didn't see any exceptions in the driver logs. Is there anyway to identify whether failover or timeout is happening?
Some other points
- The application uses connection pooling. This means that connections are created in the beginning and kept in the pool. And it may be in the pool for 72 hours or , before this issue happens
- Application uses prepared statements and the statements are preapred and kept and re used later. So the query which take s more time might be prepared before 48 hours or so.
- This is not happening every day. Many times the pattern is , it happens after 60-72 hours after application is started.
Sunil -
I want to use the Oracle OCI drivers. In Jdeveloper 3.1 s Connection Manager when I select Oracle JDBC OCI-8 Driver and if I click on Test Connection button I am getting the following Error Message.
Error Message: No ocijdbc8 in java.library.path
Dose any one knows about this? If so, Please let me know.
Thanks
Srini
nullyou have to install client 8.1.6
Ofir
[email protected] -
Jdbc oci interface and xdb API for oracle 9.2.0.7
I have a Java application that uses the jdbc oci interface to connect to an Oracle database and insert some XML into an XMLType column using the XDB APIs provided in xdb.jar.
OS : IBM AIX version 5.1
JVM : IBM 32-bit SDK pour AIX, Java 2 Technology Edition, version 1.4.2
libraries used :
ojdbc14.jar
nls_charset12.jar
xdb.jar
xmlparserv2.jar
libocijdbc9.so
with Oracle 9.2.0.1 the application worked correctly. However we have just upgraded from Oracle 9.2.0.1 to Oracle 9.2.0.7 and now the JVM crashes when the XMLType.createXML(java.sql.Connection, java.lang.String) API is called. The error message is :
JVMDG217: Dump Handler is Processing Signal 11 - Please Wait.
JVMDG303: JVM Requesting Java core file
JVMDG304: Java core file written to /<snip>/javacore2375690.1152115549.txt
JVMDG215: Dump Handler has Processed Exception Signal 11.
start.shl: 2375690 Segmentation fault(coredump)
In the javacore file we find the lines :
1XHSIGRECV SIGSEGV received at 0xdd7b7d6c in /<snip>/libocijdbc9.so. Processing terminated.
... <snip> ...
"Thread-2" (TID:0x3030B4D8, sys_thread_t:0x75A8B128, state:R, native ID:0xA0C) prio=5
4XESTACKTRACE at oracle.xdb.XMLType.createXMLTypeFromStringNative(Native Method)
4XESTACKTRACE at oracle.xdb.XMLType.<init>(XMLType.java:518)
4XESTACKTRACE at oracle.xdb.XMLType.createXML(XMLType.java:593)
Does anyone have any ideas? Changing the version from 9.2.0.7 is not an option.
Thanks,
Dave Gosling.The 9.2.0.5 patchset, and all patchsets, are available for download from Metalink.
There should be a rather large variety of JDBC drivers that will connect to an 9.2.0.5 database if that's what you're asking about.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Oracle 8.1.5 and JDBC OCI connection problem
We are running Oracle 8.1.5 on Solaris 7 machine, and our java application running on JDK 1.2 connects to Oracle via JDBC thin driver because we couldn't make jdbc oci driver work.
When we try to connect via oci with the driver originally shipped with 8.1.5, we get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:213)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JDBCTest.main(Compiled Code)
After we downloaded 8.1.6sdk driver from technet and install it, we get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at java.lang.LinkageError.<init>(LinkageError.java:43)
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:42)
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java:471)
at java.lang.System.loadLibrary(System.java:745)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:209)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JDBCTest.main(Compiled Code)
I searched this forum for answer and only relevent answer from oracle was: consult README file! Readme file mentions that lobocijdbc.so file is shared library file for oci connection. That't all. So what?
I added the directory where libocijdbc8.so resides to LD_LIBRARY_PATH, and System.getProperty("java.library.path") shows content of LD_LIBRARY_PATH correctly.
nullPlease this is not simple as simple as checking the classpath and LD_LIBRARY_PATH.
I tried the sample program and the result is the same. As pointed out first by Won, putting the libocijdbc8.so from SDK8.1.6 in the LD_LIBRARY_PATH has no effect at all. It gives the unsatisfied linker error. The sample program fails. However the sample program works fine with the libocijdbc8.so from sdk8.1.5. The library gets loaded. But at the time of creating the connection it gives make_c_state error.
Here is my CLASSPATH, PATH and LD_LIBARY_PATH variables
ORACLE_HOME=/opt/oracle/product/8.1.5
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/oracle/product/8.1.5/lib
PATH=/usr/openwin/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/ucb:/opt/oracle/product/8.1.5/lib
Hope you are able to provide better answer then check your environment variables.
THE libocijdbc8.so FROM SDK8.1.6 DOES NOT GET LOADED AT ALL.
Waiting for the reply.
Please Help.
Regards,
Vipul Modi.
Novell Inc.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Won, Taewoong([email protected]):
We are running Oracle 8.1.5 on Solaris 7 machine, and our java application running on JDK 1.2 connects to Oracle via JDBC thin driver because we couldn't make jdbc oci driver work.
When we try to connect via oci with the driver originally shipped with 8.1.5, we get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:213)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JDBCTest.main(Compiled Code)
After we downloaded 8.1.6sdk driver from technet and install it, we get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at java.lang.LinkageError.<init>(LinkageError.java:43)
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:42)
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java:471)
at java.lang.System.loadLibrary(System.java:745)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:209)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JDBCTest.main(Compiled Code)
I searched this forum for answer and only relevent answer from oracle was: consult README file! Readme file mentions that lobocijdbc.so file is shared library file for oci connection. That't all. So what?
I added the directory where libocijdbc8.so resides to LD_LIBRARY_PATH, and System.getProperty("java.library.path") shows content of LD_LIBRARY_PATH correctly.
<HR></BLOCKQUOTE>
null -
SetString/executeBatch fails in Oracle 10g OCI JDBC driver
Hi,
I am using Oracle 10g OCI jdbc driver for batch updates.
Following is the the code that I am using
import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;
public class BatchUpdates
public static void main(String[] args)
Connection conn = null;
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rset = null;
int i = 0;
try
String url = "jdbc:oracle:oci:@kctutf8";
try {
String url1 = System.getProperty("JDBC_URL");
if (url1 != null)
url = url1;
} catch (Exception e) {
OracleDataSource ods = new OracleDataSource();
ods.setUser("kctuser");
ods.setPassword("kana");
ods.setURL(url);
conn = ods.getConnection ();
stmt = conn.createStatement();
try { stmt.execute(
"create table mytest_table (col1 number, col2 varchar2(20))");
} catch (Exception e1) {}
pstmt = conn.prepareStatement("insert into mytest_table values (?, ?)");
pstmt.setInt(1, 1);
pstmt.setString(2, "row 1");
pstmt.addBatch();
pstmt.setInt(1, 2);
pstmt.setString(2, "row 2");
pstmt.addBatch();
pstmt.setInt(1, 3);
pstmt.setString(2, "row 3");
pstmt.addBatch();
pstmt.setInt(1, 4);
pstmt.setString(2, "row 4");
pstmt.addBatch();
pstmt.setInt(1, 5);
pstmt.setString(2, "row 5");
pstmt.addBatch();
pstmt.executeBatch();
rset = stmt.executeQuery("select * from mytest_table");
while (rset.next())
System.out.println(rset.getInt(1) + ", " + rset.getString(2));
catch (Exception e)
e.printStackTrace();
finally
if (stmt != null)
try { stmt.execute("drop table mytest_table"); } catch (Exception e) {}
try { stmt.close(); } catch (Exception e) {}
if (pstmt != null)
try { pstmt.close(); } catch (Exception e) {}
if (conn != null)
try { conn.close(); } catch (Exception e) {}
When I run this class I get the following output
1, row 1
2, row 3
3, row 5
4, null
5,
But It should have been
1, row 1
2, row 2
3, row 3
4, row 4
5, row 5
The same class runs fine if I use Thin driver.
Can anyone please help me solve this issue.
Note: This happens only in case we use setString with Varchar2 in the DB. This works fine if I have two number columns
Thanks,
Raja.SPlease post this question to the Java forum. It is located under "Technologies".
-
Oracle JDBC thick (OCI) driver
Hi!
Can someone point me where I can download oracle JDBC thick (OCI) driver. Thick JDBC is not installed by default in 10g. In the OTN download site I can find JDBC thin drivers to download.
Thanks
Rad.Rad,
Allow me to elaborate on Mark's answer. Let's say you download the "ojdbc14.jar" file from the OTN Web site. Both the "thick" and "thin" drivers are in that one file. You indicate which driver you wish to use in your java code -- via the database connection URL, for example:
jdbc:oracle:thin:@//myhost:1521/orclThe above indicates you wish to use the "thin" driver, whereas
jdbc:oracle:oci:@myhost:1521:orclindicates you wish to use the "thick" driver.
[Notice the difference?]
You can find more details from the JDBC FAQ.
Good Luck,
Avi.
Maybe you are looking for
-
Is there a way that I can get Automator to start a server for me after restart of Mac
Hello! I have a serverprogram from an external company that doesnt start after a restart of the mac that I run that server on. It starts the program but it doesnt start up the server of the program. All settings are right and I have consulted others
-
Photos will not sync on iPhone 6. Everything else syncs.
Tried syncing my iPhone 6 Plus today. No photos are syncing. I've checked the box to sync all photos from iPhoto. Get a message that it is syncing, but no photos are being shown as being added. Music, tones, movies, etc., all synced with no p
-
What are the minimum system requirements for Element 13?
Will Element 13 work satisfactorily on a HP X2 system running 1.5Ghz?
-
ITunes Match Step 3 Stuck on Last Song
i just signed up for iTunes Match and already experienced a bug ... Going trough installation I am stuck in Step 2 on the last song... I read on other forums that people restarted computers, stopped-restarted the installation yet after having tried e
-
recently relocated from the rural mountains into the city... previous fax communications achieved via dedicated phone line and hp 3330mfp... now confronted with Comcast cable and the bundled services... previous fax services are now antiquated and h