Classpath problem instatiating oracle driver

Hi everybody,
I have made a little desktop application that fetches sum data in a oracle database and processes it. The program runs fine when I run it from my IDE. I have downloaded the oracle driver classes ojdbc14.jar . My problem is that I cant seem to set the classpath correct when running the application from commandline.
I use the command:
java -classpath .:ojdbc14.jar:jdom.jar QueryBox
where jdom.jar is for postprocessing the data i fetch out, and QueryBox is the GUI that starts the application.
The program is started correctly but when I come down to this part in the code:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());Then an execption occurs because for some reason it cannot find the OracleDriver class when im runnin from commandline. Any help wud be much appreciated!

Don't register the driver that way - just do this:
Class.forName("oracle.jdbc.driver.OracleDriver");That registers the driver class. - MOD

Similar Messages

  • Problem with Oracle Drive Advanced Properties

    I was able to successfully set up Oracle Drive however I can’t use any of the advance features such as “set properties” and “change access control lists”. When I right click on a file I get an option for Advanced Properties but when I click on that selection I receive a message “Advanced Properties is not supported by this server.” This would be a big help to many of our users so any troubleshooting tips would be much appreciated.
    --Bill                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    We are using Portal version 10.1.2. We were able to get the options when we signed in a as the Oracle Admin but we don’t want the users to have that kind of access.
    --Bill                                                                                                                                                                                                                                                                                                                                                               

  • Problem loading oracle driver

    "I have downloaded a trial version of Weblogic server 6.1. I have the following

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Glenn Doolittle:
    What does your classpath look like? It should point to the Olite40.jar file, such as, c:\orawin95\lite\classes\Olite40.jar<HR></BLOCKQUOTE>Hi Glenn,
    Thanks for the response. I re-checked my CLASSPATH and it looks fine - just like that above. Still get the "ClassNotFoundException" error whenever it attempts to execute the line:
    Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
    It's a real mystery. Well, any other ideas you have would be appreciated. Thanks!
    Mike.
    null

  • Problem with path length when using oracle drive

    Hello!
    Does anybody else experience this problem with Oracle Drive?
    When I create a deep or nested hierarchy in which the path length is longer than 250 (the limit might be 255) characters, I cannot access the deeper subpages.
    Example:"X:\INET\START1\pfadlaengentest\das istein langer ordnername mit etwa 50 zeichen\and this is another veryveryvery long\and this is another veryveryvery lon2\and this is another veryveryvery lon3\and this is another veryveryvery lon4\and this is another veryveryvery lon5".
    I can access the page "and this is another veryveryvery lon4" but not "and this is another veryveryvery lon5"
    Is this problem due to WebDAV?
    What can I do - I think it is a critical error / bug?
    Regards Joerg.

    I opened a service request and oracle support could help me.
    The problem is the windows file system: the path length cannot be longer than 256 chars.
    There's a workaround with MS-Webfolders.
    More information is available via metalink: watch out for SR-Number 5659267.992.
    PS: Thanks to Bert
    bye :-j (joerg)

  • Oracle Drive Problem

    I am having a strange problem with Oracle Drive (v10.2.0.0.5 WinXP)
    I am connecting to Portal on AS10g R2 10.1.2 SEOne (SLES 9.3)
    http://myportal.com:7779/dav_portal/portal
    The installation went smoothly, and I can connect to the portal, login, and see the folders, but there are no files inside (I tried logging in both as a user with priviliges to manage content and as orcladmin).
    When trying to copy items to the folders, only the folders are copied, and not the files inside them. I get the following error for each file:
    There was a problem saving filename.pdf. Error 5, Access is denied.
    Subsequently, I can see the folders in the portal (with no files, of course). What is going on? Why is it saving the folders but not the files?
    Thanks,
    DC

    One more thing. I did find an FAQ doc for Oracle Drive, and it describes this error, but the suggested workaround did not fix it for me.
    http://www.oracle.com/technology/products/cs/user_info/ocontent_services/drive_index.html#015010
    FAQ ID: 015010
    Updated: 2006-08-14
    Version: 10.1.1, 10.1.2, 10.2
    When viewing a list of files in a folder, a message says "There was a problem saving filename. Error 5, access denied."
    You may see this error message if you are viewing a list of files in a folder to which you only have read access. To prevent this error message from appearing, set your Windows Explorer windows to open in List view or Details view.

  • Oracle Drive Refresh Issue

    Hello. We recently started experiencing problems with Oracle Drive automatically resetting it's refresh to an hour. We set all users on a 3 minute refresh but lately we have noticed it has been getting switched back to an hour somewhere. Anywone have any ideas how to stop it?

    I agree with Ray that you should probably be deploying certs in a different way in order to use the App Volumes product as intended (floating linked clone pools).  I would use GPOs to deploy certificates myself.
    Deploy Certificates by Using Group Policy - TechNet

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

  • 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

  • Classpath of Oracle Driver

    Hi,
    I downloaded Oracle Driver for ORacle 8i.and tried to put that in System environment variable CLASSPATh on windows NT 4.0.When I tried to restart,I had a problem of modified .dll s and later .exes.
    Could anybody guide me where to put th driver file.and if there is no Class path User environment variable shall we have to create a CLASSPATH user environment variable or PATH environment variable.
    Thank you.
    null

    Put it where ever you like as ong as the CLASSES111.ZIP appears in your classpath, you are OK.
    If you are using the OCI driver, then the Oracle_HOME/bin directory must also be in the OS Search path.

  • Problems with Drive Mapping using Oracle Drive

    It seems as though we are having some trouble with oracle drive. The install was a piece of cake, as was the configuration. The problem arises when at times we connect with the proper credentials, Oracle Drive logs the user in, but then the appropriate drive does not map. Nothing shows up under "My computer". The window will launch for the user to use Oracle Drive, but they get error messages including, "Cannot support long file names." (AKA, anything longer than 8 characters).
    Has anyone else come across these issues? Any ideas how to resolve. The issues we get with the long file names seem to only be when the drive doesn't properly map.
    Any thoughts would be helpful.
    Also, I have heard rumors of a Production version of Oracle Drive. Anyone have some news on that?

    We are very pleased to announce the Production Release 10.1.2.0 of Oracle Drive.
    You can download the software from here:
    http://www.oracle.com/technology/software/products/cs/index.html
    Note:
    - This version is production for English only. Other languages are Beta.
    - Oracle Drive 10.1.2.1 for ALL languages is expected soon.
    Find more information on Installation and Configuration as well as a Viewlet that shows Oracle Drive in Action here:
    http://www.oracle.com/technology/products/ias/portal/content_management_10gr2.html
    regards,
    Christian

  • Strange problems in Oracle 8.1.7 driver

    Hi, gurus,
    I have a strange problem in Oracle 8.1.7 ODBC driver on Windows 2000 Server. I use Visual C++ and ODBC to access database information.
    Our program uses character with ASCII code bigger than 127, for example, 170, 132, etc.
    When I try to get characters from the database, the value is different than the one I put in. For example, if I put in 132, I get back 191. It is very strange, can someone please help me out?
    Thanks a lot.
    Jerry

    I'd speculate that you're either trying to insert a character that's not defined in the database's character set or that you have a problem where you're not being consistent about whether you're requesting/providing ASCII or Unicode data.
    What are your NLS settings, both on the client and on the database?
    Justin

  • Hibernate 3 + Oracle Driver 10g = problem

    Good Day.
    I'm trying to use Oracle 10g driver to work with Oracle 9i Database through Hibernate 3.0.5. And I'm getting the following exception when Hibernate tries to build its SessionFactory:
    11:09:51,831 WARN SettingsFactory:103 - Could not obtain connection metadata
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: invalid or unknown NLS parameter value specified
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
    at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:648)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:348)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
    1. Hibernate 3.0.5 + Oracle Driver 9i works perfectly.
    2. In Windows (XP) Control Panel -> Regional and Language Options -> Advanced -> Language for non-Unicode programs
    the settings is "Russian". If switch to "English (Unated States)" - the problem dissapears.
    3. Two jars for oracle are included into the project:
    ojdbc14.jar - jar, containing OracleDriver 10g
    orai18n.jar - jar for internationalization
    Could you help me with this Exception, please.
    Best regards,
    Roman

    yorkroad wrote:
    TheAvalanche wrote:
    You need to specify your classes in the persistence.xml by adding the following after the provider-tagTrue...providing they are not already in the same deployment unit (the jar with persistence.xml in it) as they will be automagically registered with the PU.Not with Hibernate as far as I know, or it requires an additional setting in persistence.xml or something (I am not so well-versed in JPA / Hibernate)

  • Problem with ORACLE JDBC OCI-8 Driver

    Hi All,
    I'm still having problems with this driver. JDev is aware of my Oracle home, so I assume it's throwing the oraclehome/bin directory which contains the ocijdbc8.dll file into the path when it runs the connection manager.
    I tried running my test program on the command line and I get
    java.sql.SQLException: &#9658;P&#8993; -
    ` O R A - 0 6 4 0 1 : N E T C M N : i n v a l i d d r i v e r d e s
    i g n a t o r
    I have Oracle Client 8.1.5 installed and I'm using the Oracle 8.1.6 JDBC drivers that came with JDev on JDK 1.1.8
    Thanks for any help,
    Rich
    null

    Well, I realized I wasn't using the TNSNAME for my db when I switched over from the thin client to the thick client. That solved my problem when running from the command line.
    But my ConnectionManager test connection in JDev still refuses to find the ocijdbc8.dll
    Rich

  • Problem with Microsoft ODBC for Oracle Driver

    I tried to import table in MS Access with Microsoft ODBC for Oracle Driver, but a msg error appeared:
    "Reserved error (-7776); there is no message for this error"
    I think the problem is about Microsoft Jet, but i'm not sure.
    Does anybody already had this problem?

    Given that you're using a Microsoft front-end and a Microsoft ODBC driver, I'm not sure how much help you'll find on this forum. You could try substituting the Oracle ODBC driver to see if that improves anything.
    Justin

  • Problem with Oracle Thin Driver

    I use the Thin Oracle Driver (ojdbc14.jar) in my project and execute the code below.
    import java.sql.*;
    class dbAccess
         public static void main(String args[]) throws SQLException
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn =
                   DriverManager.getConnection(
                        "jdbc:oracle:thin:@dbhost:1521:ORA1",
                        "scott",
                        "tiger");
              // @machine:port:SID,   userid,  password
              Statement stmt = conn.createStatement();
              ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
              while (rset.next())
                   System.out.println(rset.getString(1)); // Print col 1
              stmt.close();
    }But then a exception occurs: "java.sql.SQLException: E/A-Exception: The Network Adapter could not establish the connection".
    Whats wrong? Do I need to install Oracle? I didn't. I just use that jar file because I read that I don't need anything else.

    1) I never configured that url, used the class from a example.
    2) I didn't configure username / password.
    3) As I said, Oracle is not installed at all. I only use the jar file.
    I read:
    > I want to create a Java application which runs on many 400 MHz
    laptops. Do I need to install Oracle completely on all these laptops
    to use Oracle database? Or can I install a "light" version, which
    doesn't use much harddisk space, RAM and prozessor time? If yes, how
    much harddisk space, RAM and prozessor time does it cost me?
    Since you're writing a Java application, I'm assuming that you'll be
    using JDBC to connect to the database.  If so, you just need to
    download the JDBC thin driver to the client machines-- no Oracle
    software needs to be installed.What is the solution?

Maybe you are looking for