Oracle JDBC problem

When I compile this code:
package DataBase;
// Import Java package for File I/O
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.naming.NamingException;
import javax.sql.*;
import oracle.jdbc.driver.*;
import oracle.jdbc.pool.*;
/*** <p>Title: </p>** <p>Description: </p>** <p>Copyright: Copyright (c) 2004</p>** <p>Company: </p>** @author not attributable* @version 1.0*/
class access_database {
public access_database() {
try {jbInit();}
catch (Exception ex) {ex.printStackTrace();}}
public static void main (String[] args) throws SQLException, IOException{
//Load and register Oracle driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//Establish a connection
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:ORCL", "scott", "tiger");
//Create a Statement object
Statement sql_stmt = conn.createStatement();
//Create a ResultSet object, execute the query and return a// resultset
ResultSet rset = sql_stmt.executeQuery("SELECT empno, ename, sal, deptno FROM emp ORDER BY ename");
//Process the resultset, retrieve data in each row, column by column//and write to an operating system file
String str = "";
while (rset.next()){str += rset.getInt(1)+" "+ rset.getString(2)+" "+rset.getFloat(3)+" "+rset.getInt(4)+"\n";}
byte buf[] = str.getBytes();
OutputStream fp = new FileOutputStream("c:\\query1.lst");
fp.write(buf);
fp.close();
//Close the ResultSet and Statement
rset.close();
sql_stmt.close();
//Close the database connection
conn.close();}
private void jbInit() throws Exception {}}
I get errors:
Exception in thread main
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
     at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
     at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
     at java.sql.DriverManager.getConnection(DriverManager.java:512)
     at java.sql.DriverManager.getConnection(DriverManager.java:171)
     at DataBase.access_database.main(DataBase.java:19)
Process exited with exit code
And a windows appear:
Fatal exception occur. Program will exit.
How can I repair this code to run perfectly?

The Network Adapter exception is caused because:
1.     The database host name or port number is wrong.
2.     The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.
C:\>lsnrctl start

Similar Messages

  • Oracle JDBC problem in Java/log4j

    HI,
    I am using log4j in my java application to log error messages using JDBCAppender to record the messages in DB tables.
    I am getting this error in JDeveloper.
    log4j:ERROR Failed to excute sql
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Here is my log4j.properties file.
    log4j.appender.JDBC2=org.apache.log4j.jdbc.JDBCAppender
    log4j.appender.JDBC2.driver=oracle.jdbc.driver.OracleDriver
    log4j.appender.JDBC2.url=jdbc:oracle:thin:@Server:port:instance
    log4j.appender.JDBC2.user=user
    log4j.appender.JDBC2.password=password
    Note: I am able to log messages using FileAppender.
    Please let me know if anybody have any solutions for this problem.
    Siva.

    Abirami,
    This problem got solved as the static variables used for the JDBCAppender class are case sensitive.
    I modifed the variables Driver and URL. Now it is working for me.
    Here is the corrected code:
    log4j.appender.db=org.apache.log4j.jdbc.JDBCAppender
    log4j.appender.db.Driver=oracle.jdbc.driver.OracleDriver
    log4j.appender.db.URL=jdbc racle:thin:server:1523 bname
    log4j.appender.db.user=username
    log4j.appender.db.password=password
    log4j.appender.db.sql=INSERT INTO LOG VALUES ('%d %-5p -%F %m')
    log4j.appender.db.layout=org.apache.log4j.PatternLayout
    log4j.appender.db.layout.ConversionPattern=%d %-5p - %m
    log4j.appender.db.Threshold=debug

  • JDBC Problem with Oracle 8.1.7. and OC4J  Version 2

    I use the following connection statement with Oracle 8.1.7. and JDeveloper 3 and Apache Server. It works fine.
    String user = "scott/tiger";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@RDL");
    The same program does not obtain the connection with JDeveloper 9i, OC4J Version 2 and Oracle 8.1.7. I do not receive any error message, no exception is thrown.
    Please help me.

    Hi Avi,
    I had already tried the thin Diriver but after yout help I try again.
    With this thin driver, I received a SQLException which helps me.
    As usual, there were a lot of different problems. The main one was that my default configuration do not use the jdbc/lib817 main jdbc/lib. There is a classe12.jar in these libs that are apparently different.
    Finally, I obtain the connection with the "thin" driver.
    Thank you very much Avi!
    Reni

  • Remote JDBC Problem with Oracle BPM Studio

    Hi all, i am facing the Remote JDBC Problem with Oracle BPM Studio.
    When i configure a Remote JDBC Connection for SQL in BPM Studio, it prompt me an error.
    The SQL Connection is configured as following :
    External Resource:
    Name : MyDS
    Type : SQL Database
    Supported Types : Remote JDBC
    Details:
    Database Type : BPM's Oracle Driver Version:10, 11
    J2EE : WLS
    Lookup Name : MyAppDS
    Configuration for "WLS"
    Name : WLS
    Type : J2EE Application Server
    Supported Types : GENERIC_J2EE
    Details:
    Initial Context Factory : weblogic.jndi.WLInitialContextFactory
    URL : t3://localhost:7001
    But, when i try to connect to the Database by using this configuration, I will get an Exception.
    An exception occurred while getting a resource from a connector.
    Detail:The connector [[ MyDS : SQL : REMOTE_JDBC ]] caused an exception when getting a resource.
    Caused by: An exception occurred while getting a resource from a connector.
    Detail:The connector [[ WLS : J2EE : J2EE ]] caused an exception when getting a resource.
    Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [[ Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory ]]
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at fuego.jndi.FaultTolerantContext.createContext(FaultTolerantContext.java:726)
         at fuego.jndi.FaultTolerantContext.<init>(FaultTolerantContext.java:79)
         at fuego.connector.impl.GenericJ2EEConnector.createInitialContext(GenericJ2EEConnector.java:177)
         at fuego.connector.impl.GenericJ2EEConnector.createStandaloneContext(GenericJ2EEConnector.java:98)
         at fuego.connector.impl.BaseJ2EEConnector.getResource(BaseJ2EEConnector.java:92)
         at fuego.connector.impl.BaseJ2EEConnector.getResource(BaseJ2EEConnector.java:76)
         at fuego.connector.J2EEHelper.getReadOnlyContext(J2EEHelper.java:86)
         ... 12 more
    Edited by: user2262377 on Jun 22, 2009 4:01 PM

    I guess the weblogic.jar is not included in the studio.
    So, i added weblogic.jar (Weblogic 10.3) and wlclient.jar (Weblogic 10.3)
    It is working in my simple java code. But, still not working in BPM Studio.
    The error logs:
    An exception occurred while getting a resource from a connector.
    Detail:The connector [OFT_APP_DS:SQL:REMOTE_JDBC] caused an exception when getting a resource.
    Caused by: java.lang.Object cannot be cast to java.io.Serializable
    fuego.connector.ConnectorException: An exception occurred while getting a resource from a connector.
    Detail:The connector [OFT_APP_DS:SQL:REMOTE_JDBC] caused an exception when getting a resource.
         at fuego.connector.ConnectorException.exceptionOnGetResource(ConnectorException.java:88)
         at fuego.connector.JDBCHelper.getReadOnlyConnection(JDBCHelper.java:93)
         at fuego.sqlintrospector.BrowserPanel.connect(BrowserPanel.java:395)
         at fuego.sqlintrospector.BrowserPanel.populateTree(BrowserPanel.java:200)
         at fuego.ui.wizards.ui.CheckTreeBrowser$1.construct(CheckTreeBrowser.java:63)
         at fuego.ui.SwingWorker$2.run(SwingWorker.java:39)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to java.io.Serializable
         at weblogic.iiop.IIOPOutputStream.writeAny(IIOPOutputStream.java:1588)
         at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2231)
         at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
         at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
         at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:225)
         at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1963)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:2001)
         at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2266)
         at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

  • Oracle JDBC Thin Driver and Firewall Problem

    Hi!
    We have Oracle 8.1.5 and Websphere App Server. There is a
    firewall between the two. A servlet creates a connection pool
    (not that of Wesphere's). The frontend is JSP/HTML (no applets).
    The servlet uses the Oracle JDBC Thin Driver for DB Connections.
    The problem is - Once the connection is freed, the connection
    pool is not being able to retrieve it and hence it created
    another one, thus reaching the max. # of connections and the
    system hangs. Restarting the DB service flushes the connection
    and the application starts running again...
    There was a similar problem discussed in this forums long ago. I
    have not yet tried mentioning the firwall port and IP in the
    connection string. But apart from that, is there any other
    setting I need to do (on firewall or for the connectionstring)
    to deal with this problem?
    Someone had suggested to punch a hole in the firewall for the DB
    port - but we can not really do that in the current scenario...
    I would appreciate if anyone could share their experience
    regarding how they resolved this issue.
    Thanks in advance,
    Vijaya.

    One more question -
    Can we use Oracle JDBC OCI driver? We do not have any appletes...
    Does it have firewall issues too? Is there any other driver that
    we can use?
    Thanks,
    Vijaya.

  • 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

  • I think Oracle JDBC Thin driver has many problems

    I developed application & applet using Oracle JDBC/Thin Drivers
    for use with JDK 1.2 and SUN JDK 1.2.2.
    In my computer, application runs correctly.
    On the other hand, applet isn't run and throws error "Cannot
    find class java/util/Map" on connecting to Oracle database.
    You know, java/util/Map class is only in SUN JDK 1.2.x and
    current web-browsers (for example, IE5.0, Netscape 4.7, ...)
    don't support Java Run time 1.2.x.
    I think this is very critial problem.
    So I tried with Oracle JDBC/Thin Drivers for use with JDK 1.1.x
    and SUN JDK 1.1.8. (Now SUN only supports JDK 1.1.8 in JDK 1.1.x
    series)
    But this time, applet throws error "Cannot find class javax/..."
    You know, JDK 1.1.8 doesn't have javax/... classes but early JDK
    1.1.x series had javax/.... classes.
    May be Oracle JDBC/Thin Drivers for use with JDK 1.1.x are made
    using these early JDK 1.1.x series, so I think Oracle JDBC/Thin
    Drivers for use with JDK 1.1.x can't be used with SUN JDK 1.1.8.
    Whatever is the matter!
    null

    You need to remote onto the server and go into start->control panel-Administration-> ODBC (or sometimes start->administration->ODBC) and set up ODBC connections . Make sure you set them up on the system tab, then you should see them in EAS. I don't remember, b ut don't think you need to restart the Essbase servise for them to take effect

  • 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());

  • Problem compiling class: "oracle/jdbc/jolt/jdbc/client/Drive

    I have this message trying to make an ear file with JBoss for a J2EE Aplication. My application access the Oracle JDBC Driver. I've seen that the class OracleDirver has a relationship to this packet inside, but this packet is not in classes12.zip. I think that it can be a bug in the code of this class.
    Did anybody had the same problem?

    You need to set the THIRD_PARTY_JDBC_CLASSPATH to the location of the oracle jdbc drivers (classes12.zip etc). You can do this in a number of ways run the db_setup use kregedit to modify the registry or on the Solaris version edit the iasenv.ksh directly.

  • Connection Problem using oracle.jdbc.xa.client.OracleXADataSource

    Unable to get a connection from connection pool Realm1tx
    Actually there are 5 connection intialized but no connection is there in active pool.Sometimes when I
    go to weblogic console and refresh the connection comes alive temporarily.Can anyone help me out for
    fixing this problem
    Driver Used:
    oracle.jdbc.xa.client.OracleXADataSource
    Error Message
    Unknown error occurred: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null sql=[SELECT Person$1.id,NULL,Person$1.id,NULL,NULL
    FROM Person Person$1 WHERE (Per
    son$1.securityId = 'admin')] throttle=[-1]
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null
    Thanks in advance.
    Ragavendra.

    Which version of oracle thin driver are you using? Oracle 920 thin driver has some issues.
    Thanks,
    Mitesh
    Ragavendra wrote:
    Unable to get a connection from connection pool Realm1tx
    Actually there are 5 connection intialized but no connection is there in active pool.Sometimes when I
    go to weblogic console and refresh the connection comes alive temporarily.Can anyone help me out for
    fixing this problem
    Driver Used:
    oracle.jdbc.xa.client.OracleXADataSource
    Error Message
    Unknown error occurred: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null sql=[SELECT Person$1.id,NULL,Person$1.id,NULL,NULL
    FROM Person Person$1 WHERE (Per
    son$1.securityId = 'admin')] throttle=[-1]
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null
    Thanks in advance.
    Ragavendra.

  • 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 servlet problem

    My code and error message are found below:
    Why can't I resolve the variable "val"?
    Thanks
    package moreservlets;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    /** Simple servlet used to test the use of packages. */
    public class TitleQueries extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Connecting to Database";
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@pc840:1521:orcl", "scott", "tiger");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery
    ("select * from emp");
    while (rset.next()) {
    String val = rset.getString(1);
    catch(ClassNotFoundException cnfe) {
    System.err.println("Error loading driver: " + cnfe);
    catch(SQLException sqle) {
    System.err.println("Error connecting: " + sqle);
    out.println(ServletUtilities.headWithTitle(title) +
    "<body bgcolor=\"#FDF5E6\">\n" +
    "<h1 align=\"center\">" + title + "</h1>\n" +
    "<h1 align=\"center\">" + val + "</h1>\n" +
    "</body></html>");
    C:\J2ee\moreservlets>javac -d "C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\W
    EB-INF\classes" TitleQueries.java
    TitleQueries.java:46: cannot resolve symbol
    symbol : variable val
    location: class moreservlets.TitleQueries
    "<h1 align=\"center\">" + val + "</h1>\n" +
    ^
    1 error

    You're declaring the variable "val" inside your while loop, which gives the variable scope inside that loop. As soon as the loop finishes executing, that variable will cease to be.
    Instead, declare the variable outside the while loop, and you can access it later on without any problems...
    String val = null;
    while (rset.next()) {
    val = rset.getString(1);
    }Just fyi though, in the current setup, you're only going to end up with the very last value retrieved from teh database, since you're overwriting val each time you loop through the resultset. If you want to keep all the variables, maybe use an ArrayList?

  • JDBC 2/Oracle driver problems

    Hello,
    I am trying to use use JDBC 2 features on an oracle 8 database. I was told that this was possible as long as i used the correct driver (Oracle 8.1.6). I have downloaded this driver, added it to the projects library's, changed JDevelopers IDE Classpath to point to "classes12.zip".
    However when i try to set up a simple connection to the database i get errors, but when i switch back to the old oracle driver (8.1.5) it works ok). Below is the code that i use to connect to the DB:
    try
    DriverManager.setLogWriter(errorOut);
    DriverManager.registerDriver (new
    oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection
    (url,"cdr","test");
    System.out.println("Coneecting to db using
    " + url);
    catch (Exception ex)
    The above code fails and produces the following errors/exceptions:
    DriverManager.initialize: jdbc.drivers = null
    JDBC DriverManager initialized
    registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@3779]
    registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@37b8]
    DriverManager.getConnection("jdbc racle:thin:@212.240.193.99:1521:inspect")
    trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@3779]
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: oracle/jdbc2/Blob
    void oracle.jdbc.dbaccess.DBAccess.setNlsParamsClient(oracle.jdbc.driver.OracleConnection)
    void oracle.jdbc.ttc7.TTC7Protocol.initNls(oracle.jdbc.driver.OracleConnection)
    void oracle.jdbc.driver.OracleConnection.<init>(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
    java.sql.Connection oracle.jdbc.driver.OracleDriver.getConnectionInstance(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
    java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
    java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
    java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)
    null

    Hi,
    Sorry, I didn't look closely enough at your error stack. The problem appears to be with the Blob class. This class has moved from classes12.zip.
    In the Oracle JDBC Developer's Guide and Reference docs (8.1.6), there is a section on upgrading from JDK 1.1.x to JDK 1.2:
    Migration from JDK 1.1.x to JDK 1.2.x
    The only migration requirements in going from JDK 1.1.x to JDK 1.2.x are as follows:
    Remove your imports of the oracle.jdbc2 package, as discussed above under "Datatype Support".
    Replace any direct references to oracle.jdbc2.* interfaces with references to the standard java.sql.* interfaces.
    Type map objects (for mapping SQL structured objects to Java types), which must extend the java.util.Dictionary class under JDK 1.1.x, must
    implement the java.util.Map interface under JDK 1.2.x. Note, however, that the class java.util.Hashtable satisfies either requirement. If you used
    Hashtable objects for your type maps under JDK 1.1.x, then no change is necessary. For more information, see "Creating a Type Map Object and Defining
    Mappings for a SQLData Implementation".
    If these points do not apply to your code, then you do not need to make any code changes or recompile to run under JDK 1.2.x.

  • 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

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

Maybe you are looking for

  • Can't Enable write cache on disk with event ID 34

    One of our clients has a performance issue similar this one: Performance issue on TS as VM - Resolution with screenshots After monitoring it we found the problem is write cache. We improve the ... I checked all other VMs, the Enable advanced performa

  • How I do a clean install of Win 8.1

    Since my initial post        "Why is option to create striped volume grayed out in disk management?" I have seen numerous threads re doing a clean install of Win 8.1. So I'm re-posting the info I got from Puget Systems  http://www.pugetsystems.com/ w

  • Error accessing reporting services - DCOM

    Hello, after a (somewhat) smooth installation of SCCM 2007 SP1 on Win2k8 server i'm noticing a problem accessing reporting site , i've seen this issue in a lot of tek tips sites pointing to DCOM permissions, however the fixes recommended don't seem t

  • Purchase and VAT details

    Please inform how to extract the purchase and VAT data from the system .

  • Does apple tv work with ee router

    does apple tv work with my ee smartbox router