Problems when using absolute() on Oracle JDBC driver

Hi all,
I wrote some codes using JDBC to access a remote Oracle server. After got the resultset, I attempted to use absolute() method to move to a specific row index and got an error. Could anyone please help me to find out the cause and the solution?
Thanks in advanced,
** We have used driver package jdbc/lib/classes.zip in ORACLE 8.1.7
** The total of records in HEFKE000 table > 1000;
** The coding is following:
String url = null;
Connection conn = null;
ResultSet rs = null;
Statement stmt = null;
String query = "select * from HEFKE000";
String dbName = "HE_MI";
String hostName = "NTTD";
String userName = "HOKEN";
String passWord = "manager";
String dbDriver = "oracle.jdbc.driver.OracleDriver";
//Load the Driver
Class.forName(dbDriver);
//get connection
url = "jdbc:oracle:oci8:@NTTD";     
//url = "jdbc:oracle:thin:@" + hostName + ":1521:" + dbName;
conn = DriverManager.getConnection (url, userName, passWord);
// It's faster when you don't commit automatically
conn.setAutoCommit (false);
// Create a Statement object so we can submit
// SQL statements to the driver
stmt = conn.createStatement();
// Submit a query, creating a ResultSet object
rs = stmt.executeQuery(query);
// Get the ResultSetMetaData. This will be used for the column headings
ResultSetMetaData rsmd = rs.getMetaData ();
// Get the number of columns in the result set
int numCols = rsmd.getColumnCount ();
int i;
if (rs.next() == rs.isFirst()) {
rs.absolute(100);
boolean more = rs.next ();
while (more) {
// Loop through each column, getting the
// column data and displaying
for (i=1; i<=numCols; i++) {
if (i > 1) {
System.out.print("|");
if (rs.getString(i) == null)
System.out.print("");
else
     System.out.print(rs.getString(i));
output.println();
// Fetch the next result set row
more = rs.next ();
** The error:
Exception in thread "main" java.sql.SQLException: Invalid operation for forward
only resultset : absolute

Thanks. However, after changed the codes as your suggestion and ran again, I got the following error:
Exception:
java.lang.OutOfMemoryError
<<no stack trace available>>
A note is that, the 'select * from HEFKE000' statement would get around 1,5 millions of records. So, the 'out of memory' above is for client side or for server side?
Thanks,

Similar Messages

  • Oracle.jdbc.driver.OracleDriver() problem

    Hi guys. I am taking a dbsystems class at school. We are required to connect to the schools oracle db using this package: oracle.jdbc.driver
    the code provided by the profesor is meant to be used by logging into unix accounts on the schools servers and running our java programs remotely. I've been trying to connect by running the java program localy.
    i'm using netbeans 4, with java5. netbeans tells me that this oracle.jdbc.driver package doesn't exist.
    here is the connection part of the code:
    //create the oracle driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //create a connection object
    Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@<blahblahblah>", "<myusername>", "<mysuperduperprivatepassword>");
    I have followed many forums and threads on the web. Most of them seem to be fixed just by renaming the classes12.zip file to .jar, placing them in the jre/lib folder and setting the path, but they all seem to be running the java program on the same computer as the database, where as i'm trying to connect remotely. i still tried following the instructions, and this still hasn't worked for me. so, my question is, will this even work since i am trying to connect remotely? and if not, how can i connect remotely to a database using only java? thanks
    gyro

    when you say build path, do u mean the same folder as my .java source? because it is. I don't know if u need to know this, but it will compile, but not run, and then it will print the above mentioned error. but in netbeans, it just tells you ahead of time why it wont run if u try to run it.
    anyways, from what i understand from what u wrote, i will need to use the thin driver...now that comes with the oracle.jdbc.driver package, but i just need to use a different call, right? like, instead of oracle.jdbc i would need oracle.thin, is this what u mean? and if it doesn't contain the thin driver, where can i find it? i found it onces before, but that was completely by accident. can someone supply a url? thanks
    jay

  • [Oracle JDBC Driver]Invalid parameter binding(s).

    Hi there
    I am using the OracleCachedRowSet, and it works fine until I tries to update a resultset with a null value. When I call rs.acceptChanges(connection); it results in the following exception.
    Please help if anyone has found a workaround to this problem.
    java.sql.SQLException: [BEA][Oracle JDBC Driver]Invalid parameter binding(s).
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
    at weblogic.jdbc.base.BaseParameters.getParameter(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:268)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.updateRow(OracleCachedRowSetWriter.java:429)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.writeData(OracleCachedRowSetWriter.java:534)
    at oracle.jdbc.rowset.OracleCachedRowSet.acceptChanges(OracleCachedRowSet.java:2926)
    at eurostat.Items.updateRS(Items.java:192)
    at eurostat.DBConnectionBean.updateRS(DBConnectionBean.java:94)
    at jsp_servlet.__mainpage._jspService(MainPage.jsp:248)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:246)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    Hi Avi
    Thanks for the suggestion, but I don't thint that is the problem. In other forums I have found people describing the same problem(both with Oracle and Sun's implementation of CachedRowSet). See this link for an example http://bugs.mysql.com/bug.php?id=9831. So I figured that those other people needed to have a solution to the problem, but I can't find it.
    /Thomas

  • How to config the CLASSPATH in Win2000 server for JDBC(oracle.jdbc.driver,*)

    I am using the OS: Win2000 Server.I need to connect to some remote DataBase,but I
    don't know how to config the driver in the CLASSPATH environment variable, my Problem is: when I import the oracle.jdbc.driver.OracleDriver ,and run the program, it warns to me that it cannot find the class,and i know i didnot config the CLASSPATH in environment variables, so I want someone to tell me how to config it ,and where should the file "class12.zip" be placed !
    Thank you! maybe the problem is a piece of cake for you ,but now i do not know how to deal with it!

    Hi ,
    try this,
    http://myjdbc.tripod.com/basic/jdbcurl.html
    Regards
    Elango.

  • JDBC Driver problem when using JDeveloper 10.1.2 with JDK 1.4

    I hope someone can help me solve this problem (which I am sure others have encountered).
    The JDK that is downloaded together with JDeveloper 10.1.2 is JDK 1.4.2. However, I believe the JDBC jar files that comes together with JDeveloper 10.1.2 are for JDK 1.2 : classes12.jar, classes12dms.jar and nls_charset12.
    What I did was I replaced the JDeveloper 10.1.2 JDBC (JDK 1.2) jar files with the JDBC jar files from JDeveloper 10.1.3 download i.e. ocrs12.jar, ojdbc14.jar, ojdbc14dms.jar and orai18n.jar and then create a new JDBC Library which references these new jar files. I was able to successfully run my applications (under my modified JDeveloper 10.1.2) using this new JDBC library (instead of the original 'Oracle JDBC' library). However, when I created a Database Connection in this modified JDeveloper 10.1.2, the connection was unsuccessful. I received the error message "Unable to find driver: oracle.jdbc.driver.OracleDriver".
    My organisation requires me to use JDK 1.4.2 and therefore I cannot use JDeveloper 10.1.3 (which I did not encounter any JDBC problem) as it is certified to run only on JDK 1.5.
    Please help. Thanks.

    JDev 10.1.2 is quite old, and was never certified for Windows 2008.
    No need to post multiple threads - same question as {thread:id=2271522}

  • Issue encountered when Login as sysdba role using Thin Oracle JDBC Driver

    Hello all,
    we are now considering to use Thin oracle JDBC driver to create database in our project, but we met one issue when we tried to connect to oracle as sysdba role using Thin driver, and it throws java.sql.SQLException: Io Exception: SO Exception was generated, I have found some tips on oracle jdbc website and it says :
    How do I connect as SYSDBA or SYSOPER?
    The only way to do this is to use the Properties object when connecting, rather than specifying the username and password as strings. Put the username into the "user" property, and the password into the "password" property. Then, put the mode into the "internal_logon" property. Something like the following:
    Properties props = new Properties();
    props.put("user", "scott");
    props.put("password", "tiger");
    props.put("internal_logon", "sysoper");
    Connection conn = DriverManager.getConnection (url, props);
    When connecting as SYSDBA or SYSOPER using the Thin driver, the RDBMS must be configured to use a password file. See "Creating and Maintaining a Password File" in the "Oracle Database Administrator's Guide".
    So, i did execute orapwd command to create a password file and also set remote_login_passwordfile=execlusive in my initxxx.ora initial parameter file, however, when i tried to connect, it failed.
    private static void createEmsdbDatabase(){
    String url = "jdbc:oracle:thin:@localhost:1521:";
    StringBuffer sqlStatement = new StringBuffer();
    sqlStatement.append("create database xxx");
    sqlStatement.append("maxdatafiles 254 ");
    sqlStatement.append("maxinstances 8 ");
    sqlStatement.append("maxlogfiles 32 ");
    sqlStatement.append("character set UTF8 ");
    sqlStatement.append("national character set UTF8 ");
    sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
    sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
    try {
    DriverManager.registerDriver(new OracleDriver());
    Properties props = new Properties();
    props.put("user", "sys");
    props.put("password", "password");
    props.put("database","xxx");
    props.put("internal_logon", "sysdba");
    Connection conn = DriverManager.getConnection(url, props);
    Statement statement = conn.createStatement();
    statement.executeUpdate(sqlStatement.toString());
    statement.close();
    conn.close();
    } catch (SQLException e) {
    e.printStackTrace();
    But what made me puzzled a lot is if i use OCI driver, it did work great, why??? guys, anybody knows, please give me some tips, thanks in advance.
    regards,
    Kaixuan @ Shanghai

    clarify my question in detail:
    Step 1 : create password file using orapwd command
    Step 2 : create database instance using oradim command
    Step 3 : login using sys as sysdba to startup database, e.g startup nomount pfile='...\initxxx.ora'
    Step 4 : create database.
    java code showing below:
    private static void createEmsdbDatabase(){
    String url = "jdbc:oracle:thin:@localhost:1521:";
    StringBuffer sqlStatement = new StringBuffer();
    sqlStatement.append("create database xxx ");
    sqlStatement.append("maxdatafiles 254 ");
    sqlStatement.append("maxinstances 8 ");
    sqlStatement.append("maxlogfiles 32 ");
    sqlStatement.append("character set UTF8 ");
    sqlStatement.append("national character set UTF8 ");
    sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
    sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
    try {
    DriverManager.registerDriver(new OracleDriver());
    Properties props = new Properties();
    props.put("user", "sys");
    props.put("password", "password");
    props.put("database","xxx");
    props.put("internal_logon", "sysdba");
    Connection conn = DriverManager.getConnection(url, props);
    Statement statement = conn.createStatement();
    statement.executeUpdate(sqlStatement.toString());
    statement.close();
    conn.close();
    } catch (SQLException e) {
    e.printStackTrace();
    issue was met here, when i tried to login as sysdba using sys, and in my java code, i use Thin driver, it then thrus exception, but when OCI driver is used, it works great, i don't know why.
    that is, when i use "jdbc:oracle:oci8:@" as database URL and then properties.put("database","xxx"), it works great. but, when i use "jdbc:oracle:thin:@localhost:1521:" as database URL and then properties.put("database","xxx"), it failed. hopefully, i have clarified my question clearly. thanks.

  • Error oracle.sql.* and oracle.jdbc.driver.* not found when using oracle as a database

    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama

    Hi Anupama,
    First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
    along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
    These are a few simple things that you should do in your JDBC program:
    1. Import the necessary JDBC classes in your programs that use JDBC.
    For example:
    import java.sql.*;
    import java.math.*;
    2. Register the Oracle driver before before calling other JDBC APIs.
    (This is not needed if you are using the JDBC Server-side Internal
    Driver because registration is done automatically in the server.)
    To register the Oracle driver, make sure the following statement
    is executed at least once in your Java session:
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    3. Open a connection to the database with the getConnection call.
    Different connection URLs should be used for different JDBC
    drivers. The following examples demonstrate the different URLs.
    For the JDBC OCI8 Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:oci8:@<database>",
    "scott", "tiger");
    where <database> is either an entry in tnsnames.ora or a SQL*net
    name-value pair.
    For the JDBC Thin Driver, or Server-side Thin Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@<database>",
    "scott", "tiger");
    where <database> is either a string of the form
    <host>:<port>:<sid> or a SQL*net name-value pair.
    For the JDBC Server-side Internal Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:kprb:");
    Note that the trailing ':' character is necessary. When you use
    the Server-side Internal Driver, you always connect to the
    database you are executing in. You can also do this:
    Connection conn
    = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    Hope this helps,
    Thanks,
    Anupama wrote:
    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama--
    Apurb Kumar

  • Problem using Oracle JDBC Driver

    Hi,
    I try to configure the Oracle JDBC Driver the following way:
    I load the Oracle drivers ojdbc14_g.jar and nls_charset12.jar
    I configure the DataSource using the Driver Class oracle.jdbc.driver.OracleDriver, the database URL: jdbc:oracle:thin:@h50a430:1521:WLP1E1A0 and the User with Password.
    As soon as its activated I get the following error:
    java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Complex error : server ID 4123350:Cannot start DataSource "Oracle".
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:678)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:660)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:535)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    any hint?

    I can't create an Oracle datasource too.
    Uploaded ojdbc14.jar, used the same Oracle jdbc settings as in my jdbc explorer where everything works fine, set initial connections to 1, set SQL Engine to Native SQL,...
    -> won't start.
    I restarted the cluster too. The Datasource is still marked with a red cross in the admin tool.
    This is with the type 1.x setting, as XA seems to be still broken in WAS 6.40.

  • Load oracle jdbc driver error when run applet via the web

    Hi All,
    I have built an applet which connect to database via jdbc thin driver. It works fine when I run it through the applet viewer, but got a problem when run it through the web.
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    I am using jdev9i 9.0.4 and jdk 1.4.2. The jdbc version is 9.0.1
    I have added both the classes12.zip and ojdbc14.zip in the class path and also pack them together with my applet class. Here is the code
    public class MyApplet extends Applet
    implements Runnable
    public void start()
    if(theThread == null)
    theThread = new Thread(this);
    theThread.start();
    Retrieve R = new Retrieve();
    this.MyMap = R.retrieveDesc();
    public class Retrieve
    public Retrieve()
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn=DriverManager.getConnection("jdbc:oracle:thin:@babyruth.wvu.edu:1703:devdw", User, Password);
    conn.setAutoCommit(true);
    connectStatus = true;
    public HashMap retrieveDesc()
    return map;
    I have also built one HTML page NewApplet like this
    <HTML>
    <HEAD>
    <TITLE> My New Applet</TITLE>
    </HEAD>
    <APPLET CODE="MyApplet.class" CODEBASE="menu" ARCHIVE="MyApplet.zip" WIDTH=300 HEIGHT=485>
    <!--General Settings-->
    <param name="bgcolor" value="255,255,255">
    </HTML>
    Any advice is highly appreciated
    Mei

    Sir,
    Well you haven't "packed" them correctly. Why don't you just add the driver bits to the soucebase tag? or something like that anyway...
    Sincerely,
    Slappy

  • Oracle jdbc driver problems in netbeans 5.5

    need help again....i'm experience a problem. the problems are :
    i connect from netbeans 5.5 to oracle database express client 10g using jdbc driver ojdbc14.jar. the connection succeded (all the tables appears and i even can view the data). but when i trying to bind data to a drop down list component (with right click to the dropdown list component and then bind data), the dataprovider of that table appear in red color and there's no field appears in that. i'm so confused? i already add the ojdbc14.jar driver to the following path :
    1. i create a new class library in netbeans with consist of that driver,
    then added to my project (right click in my project then add library).
    2. then i added the ojdbc14.jar driver to my tomcats lib at "C:\Program
    Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\common\lib".
    Is there any additional settings in using oracle jdbc driver? Does anyone knows? thanks a lot for the answers...
    Message was edited by:
    darma_sadha

    Hi!
    I'm using NetBeans 6.5 and I'm having some troubles to connect.
    The steps I've made:
    - Create the connection pool in Glassfish, nothing special, just standard parameters (Based on javax.sql.DataSource and including URL, Username and Password).
    - Create the JDBC resource associated with that connection pool,let's say jdbc/test.
    Now in NetBeans I register the driver:
    - New driver -> Find the ojdbc14.jar and from the options that I can choose it shows: oracle.jdbc.OracleDriver and oracle.jdbc.driver.OracleDriver.
    If i choose without +.driver+ I got the thin drivers (the ones i want) and if i chosse the one with the other one I got the OCI drivers. So I choose the first option oracle.jdbc.OracleDriver
    - Then I go to my project and click New -> Entity Classes from Database and from Datasource I select jdbc/test and it shows the following error message:
    Unable to find the driver oracle.jdbc.driver.OracleDriver. Please register this driver in the Databases.
    I can fix it if while registering the ojdbc14.jar I select the second option (*oracle.jdbc.driver.OracleDriver*) but with this option I need to specity the connection to use OCI instead of the desired thin driver.
    I hope you'll understand and help me somehow
    Edited by: KILE on Oct 10, 2008 2:26 AM

  • Oracle JDBC Driver Problem

    Hi,
    When I write code as
    Resultset rs = .....
    rs.last();
    there is no problem for MySQL JDBC Driver, but when I use this code for Oracle, I am getting error with line 2. Why ? Do you know any Oracle JDBC Driver that supports "rs.last()" ? Or is there another way to handle it?
    Thanks.

    Most of the JDBC Drivers can handle "rs.last()".
    The question here is, how do you create a Scrollable ResultSet using DatabaseMetaData, or if this is even possible.
    A thorough read of the API docs, for the Classes and methods being used here will answer this question (now that you know what the actual question is).

  • Problem while using BEA's Oracle Driver

    I am facing some problem while using preparedStatement.setNull while using Bea's Orale XA Driver, the same code works fine with oracle XA driver,
    Can any one plz help on this.
    Here the code
    String insertIntoTestRequestQuery = "Insert into A values(?,?,?)";
    PreparedStatement dbInsertStatement = connection.prepareStatement(insertIntoTestRequestQuery);
    dbInsertStatement.setLong(1, 3L);
    dbInsertStatement.setString(2,"test");
    dbInsertStatement.setNull(3,java.sql.Types.NULL);
    I am using Weblogic 9.2 with Oracle 9i
    here the Spy Log
    spy>> PreparedStatement[163].setNull(int parameterIndex, int sqlType)
    spy>> parameterIndex = 1
    spy>> sqlType = 0
    spy>> java.sql.SQLException: [BEA][Oracle JDBC Driver]The specified SQL type is not supported by this driver. ErrorCode=0 SQLState=HY004
    java.sql.SQLException: [BEA][Oracle JDBC Driver]The specified SQL type is not supported by this driver.
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.validateSqlType(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.setNull(Unknown Source)
         at weblogic.jdbcx.base.BasePreparedStatementWrapper.setNull(Unknown Source)
         at weblogic.jdbcspy.SpyPreparedStatement.setNull(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.setNull(PreparedStatement.java:491)

    s. laxnars wrote:
    I am facing some problem while using preparedStatement.setNull while using Bea's Orale XA Driver, the same code works fine with oracle XA driver,
    Can any one plz help on this.
    Here the code
    String insertIntoTestRequestQuery = "Insert into A values(?,?,?)";
    PreparedStatement dbInsertStatement = connection.prepareStatement(insertIntoTestRequestQuery);
    dbInsertStatement.setLong(1, 3L);
    dbInsertStatement.setString(2,"test");
    dbInsertStatement.setNull(3,java.sql.Types.NULL);
    I am using Weblogic 9.2 with Oracle 9i
    here the Spy Log
    spy>> PreparedStatement[163].setNull(int parameterIndex, int sqlType)
    spy>> parameterIndex = 1
    spy>> sqlType = 0
    spy>> java.sql.SQLException: [BEA][Oracle JDBC Driver]The specified SQL type is not supported by this driver. ErrorCode=0 SQLState=HY004
    java.sql.SQLException: [BEA][Oracle JDBC Driver]The specified SQL type is not supported by this driver.
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.validateSqlType(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.setNull(Unknown Source)
         at weblogic.jdbcx.base.BasePreparedStatementWrapper.setNull(Unknown Source)
         at weblogic.jdbcspy.SpyPreparedStatement.setNull(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.setNull(PreparedStatement.java:491)Hi. This is a known issue. Call official BEA support and open a case
    so you will be notified when a new driver will have the fix. In the
    meantime, if you set the Type to correspond to the DBMS's column type,
    it will work. In fact, I'll bet that if you just set the Type to VARCHAR
    it will work, regardless of the actual column type...
    Joe

  • Problem with Oracle jdbc driver and jdk1.4

    Hi
    I have some java code which uses Oracle jdbc driver.
    This code works with java 1.1.8, 1.2 & 1.3 but not with java 1.4 !
    I have that exception :
    java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle/jdbc/dbaccess/DBError.check_error(DBError.java)
    at oracle/jdbc/driver/OracleConnection.<init>(OracleConnection.java)
    at oracle/jdbc/driver/OracleDriver.getConnectionInstance(OracleDriver.java)
    at oracle/jdbc/driver/OracleDriver.connect(OracleDriver.java)
    at java/sql/DriverManager.getConnection(DriverManager.java:529)
    at java/sql/DriverManager.getConnection(DriverManager.java:179)
    at SimpleQuery.<init>(SimpleQuery.java:21)
    at SimpleQuery.main(SimpleQuery.java:56)
    when I try a getConnection...
    I've tried all the jdbc drivers provided by Oracle, but it's still the same problem !
    Any Idea ?
    Thanks

    Have you tried the drivers shipped with Oracle9i Db R2? they should work against JDK 1.4
    Kuassi
    Hi
    I have some java code which uses Oracle jdbc driver.
    This code works with java 1.1.8, 1.2 & 1.3 but not with java 1.4 !
    I have that exception :
    java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle/jdbc/dbaccess/DBError.check_error(DBError.java)
    at oracle/jdbc/driver/OracleConnection.<init>(OracleConnection.java)
    at oracle/jdbc/driver/OracleDriver.getConnectionInstance(OracleDriver.java)
    at oracle/jdbc/driver/OracleDriver.connect(OracleDriver.java)
    at java/sql/DriverManager.getConnection(DriverManager.java:529)
    at java/sql/DriverManager.getConnection(DriverManager.java:179)
    at SimpleQuery.<init>(SimpleQuery.java:21)
    at SimpleQuery.main(SimpleQuery.java:56)
    when I try a getConnection...
    I've tried all the jdbc drivers provided by Oracle, but it's still the same problem !
    Any Idea ?
    Thanks

  • Bug in Oracle JDBC Driver: NullPointerException when calling clearParameters

    There is a bug in the latest version of the JDBC driver that throws a NPE when calling PreparedStatement.clearParameters(). I don't need a response to this, since I have a workaround (just catching and ignoring the exception), but it should probably be fixed. I speculate that the problem only occurs when you try to call clearParameters() more than once on the same PS, but I haven't confirmed it.
    It is probably an easy fix. Following is the stack trace:
    java.lang.NullPointerException
    at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
    at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)
    at oracle.jdbc.driver.OraclePreparedStatement.clearParameters(OraclePreparedStatement.java:3401)
    at com.solarmetric.datasource.PreparedStatementCache$CachePreparedStatement.close(PreparedStatementCache.java:293)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementBatch(SQLExecutionManagerImpl.java:666)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:514)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:406)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:273)
    at com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:421)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:549)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:412)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.testMakePersistentAssignsObjectId2(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.testMakePersistentAssignsObjectId(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.runTest(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.PersistenceManagerTest.run(Unknown Source)
    at com.solarmetric.kodo.compatibility.JDOCompatabilityTestSuite$1.runTest(JDOCompatabilityTestSuite.java:493)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:524)
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

    Take a look at the method that is causing the NullPointerException:
    public void clearItem(int i)
    if (!m_dynamic && m_vector == null && i < m_vector.size())
    m_vector.removeElementAt(i);
    if (m_items != null && i >= m_items.length)
    return;
    m_items[i] = null;
    return;
    A NullPointerException will be thrown whenever clearParameters() is called when no parameters have yet been bound.
    The first IF statement should read:
    if (!m_dynamic && m_vector != null && i < m_vector.size())
    A simple workaround would be to make sure that your parameter list is never empty before calling clearParameters(). Is there a patch for this anywhere?

  • Import oracle.jdbc.driver.* problem.

    I've got classes111b.zip from this site, and put it into my $ORACLE_HOME/jdbc/lib; add this: "$ORACLE_HOME/jdbc/lib/classes111b.zip" to my CLASSPATH; use env command, I can see it, but when I visit my jsp page, there occured an error:
    Error: 500
    Location: /tmp/connectdb.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSP/jakarta-tomcat/work/localhost_8080/_0002ftmp_0002fconnectdb_0002ejspconnectdb_jsp_7.java:20: Package oracle.jdbc.driver not found in import.
    import oracle.jdbc.driver.*;
    And jdbc readme file says:
    The Oracle installer installs the JDBC Drivers in the
    [ORACLE_HOME]/jdbc directory.
    Where is the Oracle installer? How could I do?
    Thanks in advance.

    Hello
    here is the modified code
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class Oracle_Test
    public static void main(String args[])
    String sql = "";
    String strdisp = "";
    Connection con = null;
    //Statement cs = null;
    CallableStatement cs = null;
    ResultSet rs = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Hello 1");
    //con = DriverManager.getConnection("jdbc:oracle:thin:@192.1.1.70:1521:epatra","kamna_local","kamna");
    con = DriverManager.getConnection("jdbc:oracle:thin:@10.8.51.182:1521:DEVPG","RINGERS","RINGERS");
    System.out.println("Hello 2");
    try
    CallableStatement proc = con.prepareCall("{ call PHONEGEN.HOME_MDN_SEARCH_RINGER(?, ?, ?, ?, ?, ?) }");
    proc.setString(1, "2231015897");
    proc.setString(2, "1071706417");
    proc.registerOutParameter(3, OracleTypes.VARCHAR);
    proc.registerOutParameter(4, OracleTypes.VARCHAR);
    proc.registerOutParameter(5, OracleTypes.VARCHAR);
    proc.registerOutParameter(6, OracleTypes.VARCHAR);
    System.out.println("Hello 3");
    boolean x = cs.execute();
    String homemin = proc.getString(3);
    String homemdn = proc.getString(4);
    String phoneType = proc.getString(5);
    String outStatus= proc.getString(6);
    System.out.println("Hello 3");
    proc = null;
    con.close();
    con = null;
    catch(NullPointerException sqle)
    sqle.printStackTrace();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println("error in finding class "+ex);
    The Exception comes at this
    CallableStatement proc = con.prepareCall("{ call PHONEGEN.HOME_MDN_SEARCH_RINGER(?, ?, ?, ?, ?, ?) }");
    And here is the output when the rpogram runs....
    Hello 1
    Hello 2
    Hello 3
    java.lang.NullPointerException
    at Oracle_Test.main(Oracle_Test.java:31)
    Thanks for your help.....
    Looking for a solution soon
    Regards
    Abhinav

Maybe you are looking for

  • Full length feature on FCP from mini-DV... benchmarking comparable DVD's

    After over a year of post production, we just completed a full length kids' feature film shot on a DVX-100A and edited in FCP. The title is "The Bracelet of Bordeaux", and the movie info is on IMDb and our website. This was a large scale project, wit

  • Unknown error: there was a problem getting the status directory!

    Hi, Folks, I followed the instructions on this page :http://deimos.apple.com/rsrc/doc/iTunesUAdministrationGuide/AddingContent/chapte r_12_section_6.html#//apple_ref/doc/uid/AdminGuide-CH22-SW5, and try to upload a file to our university's Itunes U s

  • Storing scanned files Directly in SAP DMS?

    Hi, Is it possible to store the document in SAP DMS directly from the scanner? If i scan a document using a scanner the scanned document should be stored automatically in SAP DMS. Is it possible? Regards, MRK

  • Upscaling video in Podcast Producer

    Hi all, We have some videos that we would like to convert into Podcasts. Unfortunately these videos were originally recorded in a very low resolution. Podcast Producer handles them fine except it keeps them in the source resolution, which means the w

  • DHCP cofiguration error while installing SOA suit 10.1.3

    Hi can any one suggest how to resolve DHCP cofiguration error while installing SOA suit 10.1.3. I have win7 but getting this error . Please sort out................