Oracle JDBC driver problem for Oracle 8.1.6

i am a newbee to Java, i was trying JDBC programming thru Jbuilder 4.0. now the problem is whenever i am trying the DriverManager.getconnection(), I am getting an error "NO SUITABLE DRIVER". i have downloaded jodbc14.jar(oracle 9i JDBC driver) but so result. what can i do now? any other config issues or is it due to absence of a Oracle JDBC driver of Oracle 8.1.6.

i have set the classpath as mentioned. but no solution.
the error is like this::
java.lang.NoClassDefFoundError: java/sql/Savepoint
     at java.lang.ClassLoader.defineClass0(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
     at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
     at java.sql.DriverManager.getConnection(DriverManager.java:517)
     at java.sql.DriverManager.getConnection(DriverManager.java:177)
     at DbaseTest.DbaseForm.OpenConnection(DbaseForm.java:37)
     at DbaseTest.DbaseForm.jbInit(DbaseForm.java:73)
     at DbaseTest.DbaseForm.<init>(DbaseForm.java:26)
     at DbaseTest.Application1.<init>(Application1.java:11)
     at DbaseTest.Application1.main(Application1.java:40)
i have imported
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import oracle.jdbc.*;
import java.lang.*;
the driver is registered by:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

Similar Messages

  • Oracle JDBC driver problem for Canada locale

    Hi, there:
    I have problem on Oracle JDBC thin driver with Canada locale on client side:
    I'm using Oracle9i thin jdbc driver, the nls parameters in oracle database is:
    NLS_LANGUAGE: AMERICAN
    NLS_TERRITORY: AMERICA
    NLS_NUMERIC_CHARACTERS : .,
    My java client side is running on Windows NT, which using jdbc thin driver to connect oracle database. If I set the locale in client side as "English(Canada)", it seems return me "French" number format, like ",45" (comma, instead of decimal point) for "0.45". However, If I set client side locale as "English(United States)", it returns me "0.45" as expected.
    So, my question: does Oracle JDBC driver always returns "French" number format evenif I set "English(Canada)" as locale? Because Canada have both English and French locale "French(Canada), and English(Canada)". How can I get "English" number format like "0.45" with "English(Canada)" locale setting?
    Really appreciated any reply, and thanks a lot in advance
    David

    Sounds like a question for Oracle Support to me.
    Anyway, the way to avoid the problem is to not ask Oracle to format numbers. Get the number directly (via ResultSet.getInt() or getDouble() or whatever) and ask Java to format it.

  • JDBC Driver Problems for Oracle 10

    Trying to setup an OCI driver in our system but keep getting this response.
    INFO 2005-12-02 08:49:40,868 [STDOUT] java.lang.UnsatisfiedLinkError: C:\_EP\coldfusion\cfusion\lib\ocijdbc10.dll: The specified procedure could not be found
    INFO 2005-12-02 09:02:35,008 [STDOUT] A non-SQL error occurred while requesting a connection from DEVX2
    INFO 2005-12-02 09:02:35,008 [STDOUT] Timed out trying to establish connection
    That file exists on that path, so I'm not sure if this message means that it can't find that dll, or a procedure within that dll.
    If I set it up to use the thin client... no problems. This is very strange. ojdbc14.jar is on the classpath as well as all the DLLs needed, and I have the client installed on my machine.
    What else could I possibly need?

    Prior to 10g, Oracle claimed to require the entire Oracle client installation for the OCI driver to work; allegedly you couldn't just pick up the dlls you needed...
    With 10g, they've supplied a stripped down "Instant Client" that has just the bare bones stuff (it's still 10MB, zipped):
    http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html
    They still recommend that you install the client and add an entry to your classpath and path variables rather than trying to pick and choose what you need. I believe the 10g OCI driver is still dependent on an Oracle Net installation (which would be part of the Instant Client install, if required).
    BTW, last I knew (last year), Macromedia was discouraging the use of the OCI driver with Cold Fusion.
    Personally, I'm not aware of any significant benefits the OCI driver would provide a Cold Fusion installation. The only good reasons I've ever heard of for using the OCI driver are: to connect via IPC instead of TCP/IP (requires the database be running on the same server as the Java program), to use TAF, to use the OCI connection pooling for connection multiplexing, to take advantage of some slight performance gains with stored procedure calls. While not an expert in this area, I think only the first could possibly apply to use with Cold Fusion. The myth that OCI is substantially faster for standard SQL (non stored procedures) has been repeatedly debunked.

  • JDBC Connection Driver Problem for Oracle in a J2EE servlet/class

    Hi,
    I am having a big problem with setting up a JDBC connection with my oracle database, I have been trying to fix it for about 6 hours now with no joy, I have read that many threads about JDBC, class paths etc.. that i dont know which way is up any more!!
    Here is the issue:
    (Please bare in mind that I am new to this when posting replies)
    I have a Web Application set up as a project in the netbeans IDE. I have a servlet which creates a new object call dbaseFunc which is a public class I have wrote and within this class is a function called getAppConfigCon(). The code for this function is below:
    public Connection getAppConfigCon()
    Connection con = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","cavdev", "password");
    catch (SQLException e)
    e.printStackTrace();
    catch (ClassNotFoundException e)
    e.printStackTrace(System.out);
    return con;
    The database is Oracle XE and is installed on the same machine I am developing on, the database is up and I can connect to it via the netbeans IDE database interface after telling it where the driver is (C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip). Obviously this is just IDE functionality and allows you to browse the database objects from netbeans however I now need to know how to tell the jre where the drivers are, right??
    Well like I said multiple forums led me down the classpath route and I have a system environment variable called CLASSPATH set up with the oracle jdbc driver specified as its value, when i run the set command from the command line ( I am running Windows XP Pro) I can see the class path entry in the output as follows:
    CLASSPATH=C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.zip
    When I try to run my web app it doesnt assign the connection object with a value, i.e. when i was debugging my con object was null after calling the method mentioned above. After some time debugging i found a ClassNotFoundException was being thrown when the following command was executed:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Which I understand is because their is a problem with the class path but what is the problem??? The IDE likes the driver so why doesnt the jre.
    I am runnin jdk and jre 1.5, an Oracle XE Database using the netbeans environment.
    Some one please help me, I have spent far to much time on this rather than actually working on my project!!!!
    Thanks
    Keith

    Well After 10.5 hrs I actually sorted this myself, the two problems that were throwing me were this:
    1. Netbeans does not stop the tomcat server when it finishes running the app, you either have to stop the server from the menu or exit netbeans, until the server restarts it will not pick up on any driver files you add to common/lib
    2. You are very right Kiros tomcat does not do .zip files!!!!~~~###
    In order to sort this I had to add the oracle driver as a package to my project using the netbeans ide Project > Libraries > New Jar file, this allowed me to access the oracle classes. Then I had to set the server up to deal with the drivers as well, this meant adding the .jar file (not the latest .zip as it wont work) to the bundled tomcat common lib directory and restart the server via the ide (using the start/stop bat files in the tomcat conf directory doesnt work for some reason when its bundled with netbeans!)
    Thanks for the help guys but in the end it took 10 hrs a lot of reading and 2 bottles of lucozade to keep the brain goin.
    Keith

  • 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).

  • Oracle JDBC Driver Compile Errors

    I'd like to try out this new Preview Edition but I get the following errors:
    Error(22,8): class oracle.jdbc.driver.OracleCallableStatement is not public; cannot be accessed from outside of package oracle.jdbc.driver
    Error(23,8): class oracle.jdbc.driver.OracleTypes is not public; cannot be accessed from outside of package oracle.jdbc.driver
    These erors occur at the import statements:
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    when I attempt to compile a JDev 10.1.3 project in the 11g Technology Preview Edition. Any idea why?
    TIA,
    Jeff

    We don't support project migration from 10.1.3 to the
    technology preview.
    Does the problem reproduce if you create a new
    project in 11tp?Shay,
    Thanks for the quick response. I created a new application in 11tp from scratch. I created a View Object and pasted the offending code into it and got the same compile errors. I actually got the code about a year ago from Steve's Not Yet Documented Applications. He has since removed the App from the page, changed the code and added it to the Dev Guide. The sample app showed how to bind a View object to a REF Cursor returned from a stored procedure and it looked something like this:
    CallableStatement cs = conn.prepareCall("{?=call package.name(P_CODIGO => ?)}");
    cs.rgisterOutParameter(1,OracleTypes.CURSOR);
    cs.setInt(2,16782);
    cs.executeQuery();
    ResultSet result = ((OracleCallableStatement)cs).getCursor(1);
    Changing the code to look more like what is now in the DEV GUIDE will more than likely work because he eliminates the need for the OracleCallableStatement.
    This brings me to my next point. If migration is not currently supported, will it be when the production release of JDEV 11g is available? Shame on me for just quickly skimming the release notes but when the import wizard ran on my project it did not warn me that the feature is not supported or that problems are likely. Upon resolving the issues with the callable statement, I had significant other compile errors in my jspx pages that will probably not be as trivial to fix. If project upgrades are not performed "easily" it will certainly push the 11g adoption date out considerably.
    Thanks again, your comments are always encouraged.
    Jeff

  • How to avoid oracle.jdbc.driver.OracleConnection using

    i'am new in Java but recently i've got a project on support.
    Problem:
    solution worked on jvm 1.4, now on 1.7.
    Respectively, class oracle.jdbc.driver.OracleConnection has been used.
    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    According to the docs, it's enough to replace in code and config files one class declaration on another. But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    Project uses marven, mybatis-3.1.1. Database: oracle 9
    Driver: ojdbc14-9.2.0.5.jar contains both classes: both oracle.jdbc.driver.OracleConnection (for backward compatibility) and oracle.jdbc.OracleConnection.
    The matter is what should i do to use second one instead of first one.
    May be there is some java cache? I do not know...
    Anybody knows?

    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    Why not? You have to explain, in detail, WHAT you are trying and WHY you say you "can't" do it.
    According to the docs, it's enough to replace in code and config files one class declaration on another.
    That is correct - this IS all that is required. Replace ALL references to 'oracle.jdbc.driver' in your code.
    But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    We can't SEE what 'config' information you say you changed. It is what is in the CODE that matters, not what is in a config file.
    If the 'oracle.jdbc.driver' package is being imported by your code and a reference to 'Connection' is made Java will use it from the first package that it finds the class in.
    You are using an ANCIENT jdbc jar file. That doc you linked to WARNS you that you should upgrade and that doc is over ten years old.
    Remove that old jdbc jar file and use the current driver. Also remove references to the old package and replace them with references to the new package.
    With code and jars that are that old you can expect to have problems trying to use additional features, especially extensions. I would be surprised if you didn't have other issues as well.
    You need to perform code review to find all of the references that need to be corrected.

  • How do I determine JDBC Version? - oracle.jdbc.driver

    The following is my path and classpath and script.
    Path = D:\oracle\ora90\bin;
    D:\oracle\ora90\Apache\Perl\5.00503\bin\mswin32-x86;
    C:\Program Files\Oracle\jre\1.1.8\bin;
    %SystemRoot%\system32;
    %SystemRoot%;
    %SystemRoot%\System32\Wbem;
    C:\Program Files\Common Files\AdaptecShared\System;
    C:\Program Files\Java\j2re1.4.2\bin;
    D:\oracle\ora90\LIB
    classpath = .;
    C:\Program Files\Java\j2re1.4.2\bin;
    D:\oracle\ora90\jdbc\lib\
    JDBCVersion.java
    import java.sql.*;
    import oracle.jdbc.driver.*;
    class JDBCVersion
    public static void main (String args[])
    throws SQLException
    //DriverManager.registerDriver
    //(new oracle.jdbc.driver.OracleDriver());
    // Load the Oracle JDBC driver
    DriverManager.registerDriver
    (new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:scott/tiger@t3100:1521:oracle");
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    this throws the following:
    D:\oracle\ora90\jdbc\demo\samples\thin\basic\JDBCVersion.java:2: package oracle.jdbc.driver does not exist
    import oracle.jdbc.driver.*;
    ^
    D:\oracle\ora90\jdbc\demo\samples\thin\basic\JDBCVersion.java:14: package oracle.jdbc.driver does not exist
    (new oracle.jdbc.driver.OracleDriver());

    DON'T import the Oracle packages.
    That's all hidden from you by the java.sql code. All you do is register the driver and get a connection:
    Class.forName("driverClassName");
    Connection connection = DriverManager.getConnection("url", "user", "pswd");You might have a "ClassNotFoundException" in your future. I'll bet the JDBC JARs aren't in your CLASSPATH. Make sure they're JARs, not zips. Oracle used to have everything in classes12.zip, but now they've gotten smart and put them in JARs for 9.2.0.1. - MOD

  • CLassCastException with oracle.jdbc.driver.OracleCallableStatement

    Hello,
    I get a ClassCastException when I try to execute a Stored Procedure with WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute() method in this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    //Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    //Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
    oracle.jdbc.driver.OracleCallableStatement procout = (oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType, elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

    Hans,
    Could you give us the whole text of exception?
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    >
    It Works! Thanx a lot ....
    I was working with a previous version of my App ... I fixed the problemand now
    i can Cast to weblogic.jdbc.vendor.oracle.OracleCallableStatement,
    But ...
    I get the following Exception:
    SQL Exception:
    registerIndexTableOutParameter is not supported by the
    underlying JDBC driver weblogic.jdbc.pool.Connection
    What I need to do ?
    /* this is what i`m trying to make */
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    >
    >
    "Hans" <[email protected]> wrote:
    Thanx Slava,
    But I have the same problem again...
    I replace oracle.jdbc.driver.OracleCallableStatement with
    weblogic.jdbc.vendor.oracle.OracleCallableStatement
    and I get the same ClassClastException in
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =
    (weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    Any ideas ??
    "Slava Imeshev" <[email protected]> wrote:
    Hi Hans,
    You can not cast returned object to
    oracle.jdbc.driver.OracleCallableStatement
    when accessing oracle db via connection pool.
    It can be casted to weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    Here is a list of methods supported by this interface:
    void clearParameters() throws java.sql.SQLException;
    void registerIndexTableOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    void registerOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    java.sql.ResultSet getCursor(int i) throws java.sql.SQLException;
    java.io.InputStream getAsciiStream(int i) throws
    java.sql.SQLException;
    java.io.InputStream getBinaryStream(int i) throwsjava.sql.SQLException;
    java.io.InputStream getUnicodeStream(int i) throwsjava.sql.SQLException;
    >>>
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    I get a ClassCastException when I try to execute a Stored Procedurewith
    WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute()
    method
    in
    this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFact
    or
    y");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    file://Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    file://Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?,?, ?,
    oracle.jdbc.driver.OracleCallableStatement procout =(oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

  • JDBC driver - Class oracle.jdbc.driver.OracleDriver not found.

    Greetings:
    When I tried to compile an test script (as attached below) to test the driver, I always ended up with the following error message:
    ....java:17: Class oracle.jdbc.driver.OracleDriver not found.
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Could somebody shine some light on it? I would very much appreciate it.
    By the way, I have an Oracle DBMS (8.1.7) with jre1.1.7. My Java is jdk1.2 and the driver is ocijdbc8.dll
    Wil
    *************** The test script *************
    import java.sql.*;
    class Users
    public static void main (String args [])
    throws SQLException, ClassNotFoundException
    // Load the Oracle JDBC driver
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    // Connect to the database
    // You can put a database name after the @ sign in the connection URL.
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:oci8:@US10", "QM24202E", "QM24202E");
    // Create a Statement
    Statement stmt = conn.createStatement ();
    // Select ... table
    ResultSet rset = stmt.executeQuery ("select USERID from USERS");
    // Iterate through the result and print the ... names
    while (rset.next ())
    System.out.println (rset.getString (1));

    check out what thomas Fly wrote on another discussion forum about connection with JDBC, i tried it and i haven't gotten it
    to work yet but at least i don't have the "... not found" error,
    you should try it too, and i think it's good to tell you that i
    still haven't installed the oracle client on my windows Me PC.
    Hope this help you
    This may help also... I have Oracle installed on a Linux PC at 192.168.1.4 on my LAN, listening on port 1521. I can connect from another PC (Linux / Windows ME dual boot, though running Windows at the time of this experiment) using the following program:
    import java.sql.*;
    public class sqlLookup {
    public static void main(String[] args) throws SQLException, ClassNotFoundException {
    String dbUrl = "jdbc:oracle:thin:@192.168.1.4:1521:ORA8";
    String user = "thomasfly";
    String password = "maverick";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection c = DriverManager.getConnection(dbUrl, user, password);
    Statement s = c.createStatement();
    // SQL code:
    ResultSet r = s.executeQuery("select * from members");
    while(r.next()) {
    // Capitalization doesn't matter:
    System.out.println(r.getString("Name") + ", " + r.getString("id") + ": " + r.getString("email") );
    s.close(); // Also closes ResultSet
    I downloaded classes12.zip for Oracle 8.1.7 and put it into the C:\Windows directory, and mounted C:\Windows\classes12.zip in Forte for Java (equivalent to adding it to the classpath if I were running the program from a DOS window, rather than in Forte).
    ORA8... capitalization may be important... is the name of my database, which may be found in the tnsnames.ora file in $ORACLE_HOME/resources.
    The query gets the Name, id, and email fields from the table "members" in the database.
    This is just a barebones program, and each time it's run, the Oracle listener has to be stopped and restarted before the program can be successfully run again.

  • Oracle jdbc driver with debug capability

    I have been using MagicDraw UML to reverse engineer DDL and UML classes from Oracle databases. I recently loaded some public domain hydrology data using FEM, a geophysical data translation tool. After doing this, I get:
    Parsing failed (Oracle - sample) ORA-00942: table or view does not exist
    registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@331fd8]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@93068a]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@f18070]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@17b9223]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@107eafc]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@f2a824]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@53d29b]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@27d525]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@15d84e0]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@792357]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@1f92ac0]
    skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@517dc]
    Oracle Jdbc tracing is not avaliable in a non-debug zip/jar file
    SQLException: SQLState(42000) vendor code(942)
    MagicDraw support has suggested that I use jar or zip that provides debug capability. Where can I find such a driver?

    In the Downloads section, there are the regular JDBC drivers (i.e. ojdbc14.zip) and the debug JDBC drivers (i.e. ojdbc14_g.zip).
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Oracle JDBC Driver 10.2.0.1.0 DataBaseMetaData Incorrect For Unary FKs

    Friends,
    My firm (which is not a MetaLink subscriber) has discovered a bug in the Oracle 10g JDBC Driver (10.2.0.1.0). The bug affects unary associations, namely cases in which the foreign key of a table points to that very table's primary key.
    In such cases, method DatabaseMetaData.getExportedKeys (which is designed to return all foreign keys that reference a specified table) fails to return the foreign key reference. The method works correctly as long as the foreign key "points to" a different table. Example:
    ResultSet lResultSetForeignKeys = aDatabaseMetaData.getExportedKeys(<foo>)
    while (lResultSetForeignKeys.next())
    // NOTHING RETURNED
    In this case, the ResultSet contains no elements.
    We discovered this problem testing the same logic against a cross-section of commercial databases. All other DBMS drivers produce the correct result except for the Oracle drivers.
    If some brave soul would convert this into a MetaLink TAR we'd sure appreaciate it, and if possible we'd love to be in the loop regarding the progress on this issue. My e-mail ID is [email protected], and I'm working on behalf of Corticon Technologies, Inc.
    Sincerely,
    David Lynch
    General Manager, SOTA

    My understanding is that to be a MetaLink subscriber you have to be an Oracle customer or subscribe for Oracle support services. Since Oracle is only one of the many databases we support, and because our sole objective with Oracle is compatibility testing, it's unlikely that we will become subscribers unless it's essentially free.
    Oracle is tangential (not core) to our own offerings, so we don't have a pressing need for support. Is there some avenue for people in our shoes?

  • Oracle 8.1.5 JDBC driver problem with LONGVARCHAR

    Hi, I'm having problem with 8.1.5 release on Solaris with the
    JDBC type 4 driver (thin). If I create the following table
    create table test1 (col1 NUMBER, col2 LONG);
    Using JDBC driver to insert into the second column any string
    longer than 4000 characters causing run time exception. The type2
    driver works fine, but type2 is slow.
    String sql = "insert into test1 (col1, col2) values (1099,?)";
    PreparedStatement stmt ;
    stmt = conn.prepareStatement(sql);
    // create a string with very long value , bigger than 4096
    stmt.setString(1,string);
    stmt.executeUpdate();
    runtime exception:
    java.sql.SQLException: Data size bigger than max size for this
    type
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.check_error(Compiled
    Code)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setItem(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setString(Compiled
    Code)
    at testi.main(Compiled Code)
    Any help is appreciated.
    Thanks
    Steve
    null

    Post the full stacktrace here
    Also you might want to post jdbc related questions to weblogic.developer.
    interest.jdbc
    Kumar
    DreamNEON wrote:
    Hello,
    the NSAPI integration works, also the JSP files.
    But I have still problems with the Jdriver for my Oracle 8.1.5.
    I get the message :
    Failed to invoke startup class
    weblogic.jdbc.common.internal.JdbcStartup=weblogic.jdbc.common.internal.JdbcStartup
    when the WebLogic Server is started.
    Any ideas or hints about that?
    Thanks in advance
    Armin

  • Exception "not implemented for class oracle.jdbc.driver.T4CNumberAccessor"

    Hello I'm having some troubles dealing with 'java.sql.Date' I'm working with express edition database and I have three classes(different packages)
    1.Mapper
    2.Objects Class
    3.ConsoleTest
    I need to get an arraylist of objects, some of which contain dates, but when try to do it I get this exception
    "java.sql.SQLException: Invalid column type: getDate not implemented for class oracle.jdbc.driver.T4CNumberAccessor"
    Do you have any idea how I can implement the getDate method for this T4CNumberAccessor
    Here are the methods that I'm using
    1.Mapper
    public ArrayList<Object> getAllTaskAuctions(Connection con)
              ArrayList<Object> l1 = new ArrayList<Object>();
              String SQLString1 = "select * from taskauction natural join tasks";
    PreparedStatement statement=null;
    try
    //=== get taskauctions natural join tasks
    statement = con.prepareStatement(SQLString1);
    ResultSet rs = statement.executeQuery();
    while(rs.next())
    l1.add(new TaskAuction(rs.getInt(1), rs.getInt(2), rs.getInt(3),
    rs.getDate(4), rs.getDate(5), rs.getInt(6)));
    l1.add(new Task(rs.getInt(1), rs.getInt(2), rs.getString(3),
    rs.getString(4), rs.getString(5), rs.getString(6), rs.getInt(7)));
    catch (Exception exc)
    System.out.println("Fail in TaskAuctionMapper - getAllTaskAuctions");
    System.out.println(exc);
    return l1;
    2.ConsoleTest class
    Connection con;
         public Connection getConnection(){
              try{ 
         Class.forName("oracle.jdbc.driver.OracleDriver");
         con = DriverManager.getConnection(
         "jdbc:oracle:thin:@localhost:1521:XE", "Project", "123" );
         //username/password@[/]host[:port][service_name]
         catch (Exception e)
         {   System.out.println("fail in getConnection()");
         System.out.println(e); }
              return con;
         public static void main(String[] args) {
              ConsoleTest ct = new ConsoleTest();
              TaskAuctionMapper tam1 = new TaskAuctionMapper();
    ArrayList<Object> alt1 = tam1.getAllTaskAuctions(ct.getConnection());
    Iterator<Object> itr1 = alt1.iterator();
    while (itr1.hasNext())
    TaskAuction taskauct = (TaskAuction) itr1.next();
    //Problem, exception traced to TaskAuctionMapper
    System.out.println(
              "Task ID: " + taskauct.getTaskid()+ ", "+
              "StartDate: "+ taskauct.getStartdate()+", "+
              "User ID: " + taskauct.getUserid());
         }

    Found the answer, I shouldn't use integers as parameters of column index in the result set, but instead use String to mark the fields :)

Maybe you are looking for