JDBC thin driver Oracle 8.1.5 on Solaris
I have a problem where a query is running slow when using a JDBC driver but it runs fine when executed through SQL Plus. I've traced the JDBC connection and TKPROF shows that the query plan and says it's taking 3.4 Seconds to run. But, the query is taking more than a minute to run via the JDBC driver. The query joins 4 tables and does do full tablescans. But still executes in 3 or 4 seconds.
Here is where things get strange. If I rebuild a particular index, and do an explain plan or trace the session, it uses the index and runs in .89 seconds. This query normally returns 4 rows or less. None of the columns are Blobs. Any idea why it would run so much slower using a JDBC driver?
null
I have the same problem in my project.
The environment is:
OS: Solaris 8
JDK: 1.2.2
DB: Oracle 8.1.5
JDBC driver: thin(included in Oracle 8.1.5)
The problem was solved when I replaced the JDBC driver with thin
8.1.6 or 8.1.7 (download from otn.oracle.com). There was no
error when I read 10000+ records.
Similar Messages
-
I have downloaded oracle 8.1.6.0 jdbc thin driver(named classes12.zip) to run with jdk1.3 to access oracle 8.0.5, but when I compile and run the jdbccheckup.java downloaded from oracle website like this:
javac -classpath d:\jdbc\classes12.zip jdbccheckup.java
(compile succeed)
java -classpath d:\jdbc\classes12.zip jdbccheckup
an error occured:
Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
Why??????Try this isntead.
java -classpath d:\jdbc\classes12.zip;. jdbccheckup
an error occured:
Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
Why?????? -
Bug in Oracle JDBC thin driver (parameter order)
[ I'd preferably send this to some Oracle support email but I
can't find any on both www.oracle.com and www.technet.com. ]
The following program illustrates bug I found in JDBC Oracle thin
driver.
* Synopsis:
The parameters of prepared statement (I tested SELECT's and
UPDATE's) are bound in the reverse order.
If one do:
PreparedStatement p = connection.prepareStatement(
"SELECT field FROM table WHERE first = ? and second = ?");
and then bind parameter 1 to "a" and parameter to "b":
p.setString(1, "a");
p.setString(2, "b");
then executing p yields the same results as executing
SELECT field FROM table WHERE first = "b" and second = "a"
although it should be equivalent to
SELECT field FROM table WHERE first = "a" and second = "b"
The bug is present only in "thin" Oracle JDBC driver. Changing
driver to "oci8" solves the problem.
* Version and platform info:
I detected the bug using Oracle 8.0.5 server for Linux.
According to $ORACLE_HOME/jdbc/README.doc that is
Oracle JDBC Drivers release 8.0.5.0.0 (Production Release)
* The program below:
The program below illustrates the bug by creating dummy two
column table, inserting the row into it and then selecting
the contents using prepared statement. Those operations
are performed on both good (oci8) and bad (thin) connections,
the results can be compared.
You may need to change SID, listener port and account data
in getConnecton calls.
Sample program output:
$ javac ShowBug.java; java ShowBug
Output for both connections should be the same
--------------- thin Driver ---------------
[ Non parametrized query: ]
aaa
[ The same - parametrized (should give one row): ]
[ The same - with buggy reversed order (should give no answers):
aaa
--------------- oci8 driver ---------------
[ Non parametrized query: ]
aaa
[ The same - parametrized (should give one row): ]
aaa
[ The same - with buggy reversed order (should give no answers):
--------------- The end ---------------
* The program itself
import java.sql.*;
class ShowBug
public static void main (String args [])
throws SQLException
// Load the Oracle JDBC driver
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
System.out.println("Output for both connections should be the
same");
Connection buggyConnection
= DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:ORACLE",
"scott", "tiger");
process("thin Driver", buggyConnection);
Connection goodConnection
= DriverManager.getConnection ("jdbc:oracle:oci8:",
"scott", "tiger");
process("oci8 driver", goodConnection);
System.out.println("--------------- The end ---------------");
public static void process(String title, Connection conn)
throws SQLException
System.out.println("--------------- " + title + "
Statement stmt = conn.createStatement ();
stmt.execute(
"CREATE TABLE bug (id VARCHAR(10), val VARCHAR(10))");
stmt.executeUpdate(
"INSERT INTO bug VALUES('aaa', 'bbb')");
System.out.println("[ Non parametrized query: ]");
ResultSet rset = stmt.executeQuery(
"select id from bug where id = 'aaa' and val = 'bbb'");
while (rset.next ())
System.out.println (rset.getString (1));
System.out.println("[ The same - parametrized (should give one
row): ]");
PreparedStatement prep = conn.prepareStatement(
"select id from bug where id = ? and val = ?");
prep.setString(1, "aaa");
prep.setString(2, "bbb");
rset = prep.executeQuery();
while (rset.next ())
System.out.println (rset.getString (1));
System.out.println("[ The same - with buggy reversed order
(should give no answers): ]");
prep = conn.prepareStatement(
"select id from bug where id = ? and val = ?");
prep.setString(1, "bbb");
prep.setString(2, "aaa");
rset = prep.executeQuery();
while (rset.next ())
System.out.println (rset.getString (1));
stmt.execute("DROP TABLE bug");
nullHorea
In the ejb-jar.xml, in the method a cursor is closed, set <trans-attribute>
to "Never".
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name></ejb-name>
<method-name></method-name>
</method>
<trans-attribute>Never</trans-attribute>
</container-transaction>
</assembly-descriptor>
Deepak
Horea Raducan wrote:
Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
prevent it from closing the open cursors ?
Thank you,
Horea -
Bug in Oracle JDBC thin driver 8.1.6 ?
Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
prevent it from closing the open cursors ?
Thank you,
HoreaHorea
In the ejb-jar.xml, in the method a cursor is closed, set <trans-attribute>
to "Never".
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name></ejb-name>
<method-name></method-name>
</method>
<trans-attribute>Never</trans-attribute>
</container-transaction>
</assembly-descriptor>
Deepak
Horea Raducan wrote:
Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
prevent it from closing the open cursors ?
Thank you,
Horea -
Jdbc oracle jdbc-thin driver subname
I am working on Windows 2000 environment, using oracle8i 8.1.7 JDBC-Thin driver for use with JDK 1.2.x. The oralce8i 8.1.7 database is on another linux box. I can access the linux box through its ip address, but not by its hostname since it's not accessiable by the dns server. In my code, in the JDBCUrl, I used ip address instead of the hostname, e.g. "jdbc:oracle:thin:@10.0.113.108:1521:ora1". But I got the error like: "java.sql.SQLException: Io exception: The Network Adapter could not establish the connection". If I add a entry in my working machine's hosts file to map the hostname, I can fix the problem. But I don't know if this is the solution, or there is other better solutions.
Thanks
nullUsing a hosts file entry is a common solution for problem where the dns lookup does not contain an entry for a RDBMS server platform.
The real solution is to resolve this issue :
"where the dns lookup does not contain an entry for a RDBMS server platform." -
Oracle JDBC thin driver on NT vs IBM mainframe Linux
We are develping an Java 3-tier web application on NT platform. The database is Oracle 9i. The JDBC Driver is Oracle thin driver (oracle.jdbc.driver in classes12.jar). Java is JDK1.3. We are told recently that we may need to deploy this application on IBM mainframe Linux systems when we go production. pplication server will be running on IBM mainframe Linux, and assume Oracle will be the same.)
My question is if you know that we will be able to use the same Oracle thin driver that we use on NT platform when we deploy our application to IBM mainframe Linux system. Is there a specific JDBC driver that we must use when running application server and Oracle on IBM mainframe Linux
Thanks for your help in advance.Hello,
No, thin driver is same for all platforms (binary) - You must set SQL*Net on Linux only
regards -
Oracle JDBC thin driver question
Does anyone know if there is a JDBC thin driver available for Oracle that supports "HTTP tunneling" of the SQLNET wire protocol?
Such a driver would package the SQL*NET data stream into HTTP or HTTPS packets and connects to a Servlet proxy on the Web host that unpacks the data and forwards the SQL*NET stream to the Oracle RDBMS and returns the response the same way.
This would help me overcome some firewall issues I'm seeing since HTTP/HTTPS ports are usually opened through a firewall. I know Sybase has a JDBC dirver that does this for their TNS protocol and was hoping some company has developed this for Oracle.
Thanks in advance...The easiest thing to do is download it as an archive with your applet.
Otherwise, you have to have the files on every client machine.
For netscape, put the classes111.jar in the java classes folder typically:
c:\ProgramFiles\Netscape\Communicator\Program\java\classes.
I'd expect that IE would be setup in a similar way. -
Oracle JDBC Thin Driver for oracle 9.2.0.4
Hi,
It would be nice if someone please guide me to the download of Oracle JDBC Thin Driver for oracle 9.2.0.4.
Thanks in anticipationuser566773,
As far as I know, all Oracle JDBC drivers are meant to be backward compatible.
According to the table on the following Web page, the latest Oracle JDBC driver can be used with Oracle 9.2.0.x DBMS.
http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
Good Luck,
Avi. -
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. -
Jdbc thin driver to connect oracle as internal
I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file.
Please let me know.Hi Minol,
Have a look at this code example that shows how to Connect to Database as internal ( as sysdba ). In this code sample the properties are hard-coded, you can supply these Properties by loading them from a properties file.
Connecting to Oracle Database with DBA privileges
http://myjdbc.tripod.com/basic/codeindex.html
The code snippet to load properties from a properties file
//Import IO related classes
import java.io.IOException;
// Necessary support classes
import java.util.Properties;
import java.util.Enumeration;
import java.util.ResourceBundle;
* This method reads a properties file which is passed as
* the parameter to it and load it into a java Properties
* object and returns it.
* @param file File path
* @return Properties The properties object
* @exception IOException if loading properties file fails
* @since 1.0
public static Properties loadParams(String file)
throws IOException {
// Loads a ResourceBundle and creates Properties from it
Properties prop = new Properties();
ResourceBundle bundle = ResourceBundle.getBundle(file);
// Retrieve the keys and populate the properties object
Enumeration enum = bundle.getKeys();
String key = null;
while (enum.hasMoreElements()) {
key = (String) enum.nextElement();
prop.put(key, bundle.getObject(key));
return prop;
}Regards
Elango. -
Jdbc thin driver connect oracle as internal
I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file.
Please let me know.Hi Minol,
Have a look at this code example that shows how to Connect to Database as internal ( as sysdba ). In this code sample the properties are hard-coded, you can supply these Properties by loading them from a properties file.
Connecting to Oracle Database with DBA privileges
http://myjdbc.tripod.com/basic/codeindex.html
The code snippet to load properties from a properties file
//Import IO related classes
import java.io.IOException;
// Necessary support classes
import java.util.Properties;
import java.util.Enumeration;
import java.util.ResourceBundle;
* This method reads a properties file which is passed as
* the parameter to it and load it into a java Properties
* object and returns it.
* @param file File path
* @return Properties The properties object
* @exception IOException if loading properties file fails
* @since 1.0
public static Properties loadParams(String file)
throws IOException {
// Loads a ResourceBundle and creates Properties from it
Properties prop = new Properties();
ResourceBundle bundle = ResourceBundle.getBundle(file);
// Retrieve the keys and populate the properties object
Enumeration enum = bundle.getKeys();
String key = null;
while (enum.hasMoreElements()) {
key = (String) enum.nextElement();
prop.put(key, bundle.getObject(key));
return prop;
}Regards
Elango. -
JDBC Thin-Driver and Oracle Stored Procedure
I've got a Oracle stored procedure which returns a Oracle record.
How can I retrieve the record in java using the JDBC Thin-Driver ?
Record:
TYPE messagerec IS RECORD
(log_level VARCHAR(2), timestamp VARCHAR2(19), text VARCHAR2(200));Using PL/SQL BOOLEAN, RECORD Types, and TABLE Types:
Oracle SQLJ and JDBC do not support calling arguments or return values of the
PL/SQL BOOLEAN type or RECORD types. Also, when using the Thin driver, they
do not support calling arguments or return values of PL/SQL TABLE types (known
as indexed-by tables). TABLE types are supported for the OCI driver.
Check the following guide,
http://otn.oracle.com/tech/java/sqlj_jdbc/pdf/a96655.pdf -
JDBC thin driver and Oracle 8.1.6
Hi,
I have installed Oracle 8.1.6 on Windows NT 4.0 with service pack 4 and using Oracle JDBC thin driver driver (classes111.zip). My application is multithreaded, but each thread maintains its own connection (and own set of Statements). Things are okay in single threaded mode, but in multi threaded mode, I get weird errors!
1. My resultsets are SCROLL_SENTITIVE and UPDATABLE
2. Sometimes, while updating a row, "No current row" SQLException is thrown, although a row exists that satisfies my select criteria
3. I am also calling executeUpdate() for inserting new rows and such rows are not seen by successive resultsets!
Appreciate any hints! Thanks!Try this isntead.
java -classpath d:\jdbc\classes12.zip;. jdbccheckup
an error occured:
Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
Why?????? -
Sql_trace does not work for Java app using Oracle JDBC thin driver
Hi,
I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
Thanks in advance!Hi,
I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
Thanks in advance! -
Hanging problem with Oracle JDBC thin driver
Hi. We have an application running on top of WLS 6.1 accessing Oracle 8I with oracle's
JDBC thin driver. Under stress testing, it appears to hang sometimes. Thread dump
shows that many threads seem to be stuck at the same line of code in JDBC driver
(at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)). Has anyone run into similar
issue? Any help is much appreciated.
"ExecuteThread: '1' for queue: 'default'" daemon prio=5 tid=0xe18960 nid=0xf wai
ting on monitor [0xb3680000..0xb36819d8]
at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
va:1771)
at oracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
a:3357)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
66)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
23)
at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
:401)
at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
at weblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
aightReader.java:198)
at weblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
"ExecuteThread: '6' for queue: 'default'" daemon prio=5 tid=0x6d93a8 nid=0x14
wa
iting on monitor [0xb3180000..0xb31819d8]
at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
va:1771)
at oracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
a:3357)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
66)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
23)
at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
:401)
at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
at weblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
aightReader.java:198)
at weblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)Try get the latest thin driver from oracle and place it in the beginning of
the classpath in the server startup script to use it. This seems like a
oracle thin driver bug, the newer driver might help.
sree
"Andrew Dong" <[email protected]> wrote in message
news:[email protected]...
>
Hi. We have an application running on top of WLS 6.1 accessing Oracle 8Iwith oracle's
JDBC thin driver. Under stress testing, it appears to hang sometimes.Thread dump
shows that many threads seem to be stuck at the same line of code in JDBCdriver
(at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)). Has anyone run intosimilar
issue? Any help is much appreciated.
"ExecuteThread: '1' for queue: 'default'" daemon prio=5 tid=0xe18960nid=0xf wai
ting on monitor [0xb3680000..0xb36819d8]
at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
atoracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
va:1771)
atoracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
a:3357)
atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
66)
atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
23)
atoracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
:401)
at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
atweblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
atweblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
aightReader.java:198)
atweblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
>
"ExecuteThread: '6' for queue: 'default'" daemon prio=5 tid=0x6d93a8nid=0x14
wa
iting on monitor [0xb3180000..0xb31819d8]
at oracle.sql.NUMBER._isPositive(NUMBER.java:2882)
at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:2953)
at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:557)
at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:1872)
atoracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.ja
va:1771)
atoracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.jav
a:3357)
atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
66)
atoracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:41
23)
atoracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java
:401)
at weblogic.jdbc.jts.ResultSet.getObject(ResultSet.java:268)
atweblogic.jdbc.rmi.internal.ResultSetImpl.getObject(ResultSetImpl.java:592
atweblogic.jdbc.rmi.internal.ResultSetStraightReader.getObject(ResultSetStr
aightReader.java:198)
atweblogic.jdbc.rmi.SerialResultSet.getObject(SerialResultSet.java:682)
>
>
Maybe you are looking for
-
How to use external java files into my project
Hi all, I need your help to import my external java files in to my project. The files are in package folder. So how to tell the import command with the path of the folder. I read also that I can make a jar file and integrate it into the project. How
-
Configuring Cisco ISE for Authorization with External Radius Server attribute
Hi, I'm trying to integrate an external radius server with Cisco ISE. I created an External Identity Store>Radius Token Server. I created a Identity Store sequence with just one identity store just as creadted above. And I was able to authenticate su
-
How to enable syslog error logging in CF801? Its old & documented bug #47314 [http://www.adobe.com/support/coldfusion/releasenotes/mx/knownissues_mx_j2ee_p2.html] In the ColdFusion MX Administrator,on the Debugging & Logging > Logging Settings page,
-
Why won't iTunes play a full album in order when there are featured guests on the album?
I have downloaded numerous CD's that have featured guests and iTunes will not play them in order or at all if I play the album. What can I do to fix this issue?
-
New SAP Solutions Category ...
HI SDNers, We heard it often requested and now we did open forums for all major SAP Applications: https://forums.sdn.sap.com/index.jspa#16 The list of forums was getting really long and this is why we put all categories on top for easier access. Hop