Technical FAQ: Questions about jDriver for OracleFAQ Index
Why have I been receiving the following error message from my Oracle 8
server when using a There is a problem in the Oracle 8
server that causes this error when using a I have been receiving the following error message when using your JDBC driver for Oracle: "The ordinal 40 could not be loaded in the dynamic link library OCIW32.dll" This problem is caused by an out-of-date version of OCIW32.DLL in your system directory. Some programs install this file in the system directory in order to run. If you remove this file from the system directory you should no longer receive this error.
Our servlet application uses the Oracle JDBC
thin drivers to access a database that includes BLOB fields. We
installed jDriver for Oracle and the same code fails with the following
exception:
We set the Isolation_level to 1 in our code that calls the RogueWave JDBCServer class. This works with the Oracle thin driver but fails with jDriver for Oracle. Any clues?
jDriver for Oracle supports the following transaction isolation levels:
We're running Oracle on HP-UX 10.2. Can we use jDriver for Oracle? jDriver for Oracle requires HP-UX 11.0. Native threads are not available on HP-UX 10.2 and there are other problems with the JVMs on that OS. We recommend that you run jDriver for Oracle with HP-UX 11.0 with the latest available JDK and HP patches. See the next FAQ for more information about jDriver for Oracle on HP-UX 11.0.
When I run dbping to test my connection to Oracle, I get the following error message:
java.sql.SQLException: ORA-01019: unable to allocate memory in the user I'm using Oracle server 7.3.4, with Oracle 7.3.4 client libraries and jDriver for Oracle on HP-UX 11.0. What's going on? You need to install Oracle 8.0.4 client libraries. jDriver for Oracle drivers running under HP-UX 11.0 require the Oracle 8.0.4 client environment and a server version of at least 7.3.4. Also, make sure that the environment variables ORACLE_HOME and ORACLE_SID are set properly.
I am having trouble using Unicode codesets with the jDriver for Oracle driver. How can I use a codeset in my Oracle database with the WebLogic JDBC drivers? There are two important things you must do to use Unicode codesets:
The Developers Guide has more information about internationalization support. For general information about Unicode see the Unicode website. For a list of Unicode language abbreviations, see the JavaSoft website. Do you support Oracle 8? All features, or only a subset, and if so, which features are supported? Can I use WebLogic to talk to both a 7.3 server and an 8.0 server? See the WebLogic Platforms page for details on Oracle client and server support.
I am using jDriver for Oracle 3.0.x and Oracle 7.x client libraries with Oracle 8. How do I connect the 7.x product to the Oracle 8?
According to Oracle, the TNSNAMES.ORA file has been moved from
$ORACLE_HOME/network/admin to $ ORACLE_HOME/net80/admin. You will need
to copy the file:
July 1997: We have had reports of problems with jDriver for Oracle hanging on Windows NT. We have traced this to the Oracle 7.3.3 client libraries, which was released in late June 1997. The solution is to install the 7.3.4 client libraries, which are required with jDriver for Oracle Release 3.0 and later.
Does the WebLogic jDriver for Oracle driver work with IBM VisualAge for Java? Because of a bug in VisualAge JNI, jDriver for Oracle does not currently work with VisualAge for Java. The jDriver for Oracle native layer receives incorrect values from VisualAge JNI. Until the VisualAge bug is fixed, you should use a type 4 JDBC driver for Oracle, such as Oracle's own JDBC driver.
Does the WebLogic jDriver for Oracle driver work with Oracle 7.3? If so, does it use the multithreading capability of Oracle 7.3 when making multiple simultaneous connection with Oracle using the same username? Yes, jDriver for Oracle does work with Oracle 7.3. In fact, for WebLogic version 2.5.4 and later, we require the use of the Oracle 7.3.4 client libraries because of several Oracle bugs that were fixed in Oracle's 7.3.4 release. jDriver for Oracle should take advantage of the MTS, since this functionality is below the level of OCI and SQLNet.
I'd like to set up a WebLogic JDBC connection pool so that it uses the authentication associated with the user who is running my client application. I'm using jDriver for Oracle. How can I do that? Using OS authentication in connection pools essentially means that you are using the userid of the user that started the WebLogic Server. This means that database security will rely strictly on the security of WebLogic; that is, if you are allowed to make a client connection to the WebLogic Server and access the pool, then you can get to the database. You can do this with jDriver for Oracle because Oracle uses the process owner to determine who is attempting the connection. In the case of WebLogic JDBC, this is always the user that started the WebLogic Server. To set up your Oracle instance to use this feature, your DBA needs to follow these basic steps. The full procedure is described in more detail in your Oracle documentation.
Once the userid has been set up, you can connect with jDriver for Oracle by specifying "/" as the username property and "" as the password property. Here is an example for testing this connection with the dbping utility: $ java utils.dbping ORACLE "/" "" myserver Here is a code example for jDriver for Oracle: Properties props = new Properties(); props.put("user", "/"); props.put("password", ""); props.put("server", "myserver"); Class.forName("weblogic.jdbc.oci.Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:weblogic:oracle", props); Here is how you set up the registration of a connection pool (this one named "eng") for use with this system: weblogic.jdbc.connectionPool.eng=\ url=jdbc:weblogic:oracle,\ driver=weblogic.jdbc.oci.Driver,\ initialCapacity=4,\ maxCapacity=10,\ capacityIncrement=2,\ props=user="/";password="";server=myserver weblogic.allow.reserve.weblogic.jdbc.connectionPool.eng=guest,joe,jill The second property sets up an access control list for this connection pool and gives the users "guest," "joe," and "jill" the same database privileges as the user that started the WebLogic Server.
I am confused about what type of object will be returned by the ResultSet.getObject() method. What can I expect if my database column is a NUMBER(16,4), or just NUMBER? jDriver for Oracle always returns a Java object that will preserve the precision of the data retrieved. With Release 2.5 and later, jDriver for Oracle returns the following from the getObject() method:
For example, 1.0000 will be an integer. We will return a long for a value such as 123456789123.00000. If a value has a non-zero fractional component we return a Double if the precision of the value can be represented by a Double; otherwise we return a BigDecimal.
Will SQL*Net V1 work with the 2.5 release of WebLogic's software, specifically the JDBC drivers? We recommend that you use SQL*Net V2. SQL*Net V1 is no longer included with the Oracles releases after version 7.3.3. The WebLogic jDriver for Oracle JDBC driver (version 2.5.4 and later) requires the Oracle 7.3.4 client libraries. If you do not know what version of SQL*Net you have, or what the differences between V1 and V2 of SQL*Net are, contact your DBA or Oracle technical support. We have been trying to establish connectivity between Java and Personal Oracle 7 on Windows95, but we haven't been successful. Is there a problem with compatibility? You must be using the Oracle 7.3 client libraries in order to use jDriver for Oracle with Windows 95.
I want to limit the number of Oracle database connections generated by the WebLogic Server in response to client requests. How would I do this? If you want to limit the number of database connections used by the WebLogic Server, you can use connection pools. Connection pools allow T3Clients to share a fixed number of database connections. For more information on how to set up connection pools, see the Developers Guide, Using WebLogic JDBC.
I'm tuning my connections between WebLogic and an Oracle database and I've used up all of my allocated Oracle processes. The database is running on a Solaris platform; the client is running Oracle 7.2.x (or earlier). Why am I exceeding the limit? In Oracle versions prior to 7.3, Oracle has hardwired a connection limit in its Oracle Call Interface (OCI) libraries, which WebLogic uses to implement the jDriver for Oracle drivers. The number of connections allowed by OCI from a given client varies depending on the Oracle version and platform. For the Solaris platform there is hardwired limit of 50 connections. The solution is to upgrade to Oracle 7.3.3 or later. In these later versions, Oracle has increased the hardwired limit on the number of connections to much greater than 50. Note that on UNIX platforms you must also upgrade your WebLogic software to version 2.5 or later, because earlier versions of the WebLogic JDBC drivers use the Oracle 7.2 OCI libraries.
When I use the getObject() method to retrieve values stored in an Oracle DBMS number column, I expect to get back doubles, but the values are being returned as integers. I'm running WebLogic 2.5.1 and JDK 1.1.4 with Oracle 7.3.2. WebLogic jDriver for Oracle is conservative in converting data types when data is returned with the getObject() method, to guard against a loss of precision. To get back a single data type when retrieving number values from an Oracle number column, use the getDouble() method to return all of the values as doubles. If you want more precision, you can use the getBigDecimal() method, but you will have to state a scale for the values returned, which might involve rounding some values. Using the getString() method is another option that insures precision, but it will require more manipulation if you want to do further calculations.
I'm working with the CallableStatement methods for the jDriver for Oracle driver and having trouble calling an Oracle procedure that has no parameters. How can I call a stored procedure with no parameters from Java? Here is what we use that works: CallableStatement cstmt = conn.prepareCall("Begin procName; END;"); cstmt.execute();where procName is the name of an Oracle stored procedure. This is standard Oracle SQL syntax that works with any Oracle DBMS. You might also use the following syntax: CallableStatement cstmt = conn.prepareCall("{call procName};"); cstmt.execute(); This code, which conforms to the Java Extended SQL spec, will work with any DBMS, not just Oracle.
I'm using jDriver for Oracle. I cannot get the PreparedStatement class to bind Strings in a statement. The setString() method doesn't seem to work. Here is how I set up the PreparedStatement: String pstmt = "select n_name from n_table where n_name LIKE '?%'"; PreparedStatement ps = conn.prepareStatement(pstmt); ps.setString(1, "SMIT"); ResultSet rs = ps.executeQuery(); You can't bind a value into another value in a PreparedStatement. The complete value needs to be specified in a String (without using embedded quotes) and then bound to an unquoted question-mark (?). Here is the corrected code: String matchvalue = "smit%"; String pstmt = "select n_name from n_table where n_name LIKE ?"; PreparedStatement ps = conn.prepareStatement(pstmt); ps.setString(1, matchvalue); ResultSet rs = ps.executeQuery();
I'm using jDriver for Oracle on Solaris with an 8-bit character set, but I'm not seeing the characters I expect. What's the problem? If you are using an Oracle database with an 8-bit character set on Solaris, make sure you set NLS_LANG to the proper value on the client. If NLS_LANG is unset, it defaults to a 7-bit ASCII character set, and tries to map characters greater than ASCII 128 to a reasonable approximation (for example, á, à, â would all map to a). Other characters are mapped to a question mark (?).
I'm using the jDriver for Oracle driver with an Oracle server that is based on a non-English codeset. Most characters that I insert or select pass through the driver fine, but certain characters are changed. Why is that? Our drivers depend on the Oracle client software to do codeset conversion. For certain codesets -- especially multibyte codesets -- the Oracle codeset conversion tables are incomplete or invalid. This mainly pertains to multibyte codesets. If your Oracle client installation is older than version 7.3.3, we suggest that you upgrade to the latest version of the Oracle client software.
When I am using the jDriver for Oracle driver with my Oracle database, how can I find out what foreign language codesets I can access and use? To find out what codesets you currently have available in Oracle, execute the following SQL query from SQLPlus at the command line: SQL> SELECT value FROM v$nls_valid_values WHERE parameter='CHARACTERSET';The response will be a listing of all of the codesets currently installed on your system. This listing will look something like the following shortened list: VALUE ----------------------------------------------------------- US7ASCII WE8DEC WE8HP US8PC437 WE8EBCDIC37 WE8EBCDIC500 WE8EBCDIC285 ... If you want to constrain the value in the query to a specific codeset you are searching for, you might use a SQL query like the following: SQL> SELECT value FROM v$nls_valid_values WHERE parameter='CHARACTERSET' and VALUE='AL24UTFFSS';This would produce the following response if the codeset is installed: VALUE ------------------------------------------------------------- AL24UTFFSSAdditional codesets can be added using Oracle's installation tools. Contact Oracle for more information.
I am having a problem with my jDriver for Oracle application that is producing a SQLException. There is an Oracle ID number in it that I do not recognize. How do I look this up? Here is an example: java.sql.SQLException: ORA-12536: TNS: operation would block You can look up an Oracle error by using the oerr command. For example, the description of error ORA-12536 can be found with the command: > oerr ora 12536
I'm using jDriver for Oracle. I'm getting the error "ORA-6502: value or numeric error" as the result of a stored procedure, using a CallableStatement. What does this mean? The default length of a string bound to an OUTPUT parameter of a CallableStatement is 128 characters. If the value you assign to the bound parameter exceeds that length, you will get this error. You can adjust the length of the value of the bound parameter by passing an explicit length with the scale argument to the CallableStatement.registerOutputParameter() method.
I'm using jDriver for Oracle and getting the following error: Error while trying to retrieve text for error ORA-12705What does this mean? This error occurs when you have not set the ORACLE_HOME environment variable properly -- a common mistake. In order to use jDriver for Oracle, the Oracle client software needs to be installed and ORACLE_HOME must be set. You may also see this error message if you try to use jDriver for Oracle's internationalization capabilities with a language/codeset combination that is not installed on your system. If you get the ORA-12705 error with the correct error text, then either you have set NLS_LANG improperly, or you do not have the right codesets installed on your system.
I'm using AIX JDK 1.1.2 with jDriver for Oracle and I get the following Exception: java.lang.ExceptionInInitializerError When I run dbping, I get this message: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:111) at utils.dbping.main(dbping.java:52) What's going on? The AIX JDK 1.1.2 does not invoke a static block when the Class.forName() method is used. The static block needs to be called for a driver to register with the DriverManager. The problem and solution are similar to the one for using IE3.01. Load the JDBC driver by calling the Driver.connect() method directly in your code, instead of invoking Class.forName. Here is an example: Driver d = new weblogic.jdbd.oci.Driver(); Connection conn = d.connect("jdbc:weblogic:oracle",props); Also see Why do I get a "No suitable driver" message using IE3.01? in this document for more information about Class.forName and static blocks.
When I use Oracle's database link to update my database, temporary table locks are created and the server runs out of resources. The error I get is "maximum number of temporary table locks exceeded". I'm careful to close my result sets and statements when I've finished. What is going on? The database link is an object in the local database that allows you to access tables, views, and such in a remote database. The database link is controlled by the Oracle server, so the jdbc/Kona driver has no control over its use of resources. What happens is the link appears to perform the commit (since other processes could see the records that were being created) but it doesn't free any resources until the connection is closed. The solution is to remove the database link and use the JDBC driver to do your selects, inserts, and updates.
We're using your Oracle JNI jDriver for Oracle drivers on HP-UX 11.x. The Oracle server is running version 7.3.2 and is using a 8859-9 (WE8ISO8859P9) codeset. When a client tries to connect, we get a connection failure (Oracle error message ORA-24365). What's the problem? There are several problems. The Oracle 7.3.2 server doesn't support AL24UTFFSS (UTF-8) codesets, which is the codeset that JDBC uses when the NLS-LANG variable is not set to 8859-1. These codesets are only supported in version 7.3.4 and later for HP-UX 11.x. The WebLogic drivers do not generate 8859-9 codepoints. You will need to upgrade your Oracle server installation to 7.3.4 or later to get the appropriate codeset support. |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|