• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can not connect to Oracle DB from Netbeans 7

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ahmed hosni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
run:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:220)
at java.net.URLClassLoader$1.run(URLClassLoader.java:209)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:208)
at java.lang.ClassLoader.loadClass(ClassLoader.java:325)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:270)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:338)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at DisplayAuthors.main(DisplayAuthors.java:17)
java.lang.NullPointerException
at DisplayAuthors.main(DisplayAuthors.java:44)
BUILD SUCCESSFUL (total time: 0 seconds)
 
Ahmed hosni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please help
 
Ranch Hand
Posts: 144
Oracle Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ahmed hosni wrote:run:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver



The oracle jdbc driver is not added to the classpath.
 
Ahmed hosni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How i can insure that ?
 
Ahmed hosni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i have another problem



Error: Could not find the main class Start.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" Java Result: 1
 
Mike Zal
Ranch Hand
Posts: 144
Oracle Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ahmed hosni wrote:How i can insure that ?



In the Projects window, right click on your project and select Properties. In the Properties box, select Libraries. Click on the Add JAR/Folder button to and point to the jdbc jar file.

Ahmed hosni wrote:
Error: Could not find the main class Start.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" Java Result: 1



I cannot see your project layout so I can't answer that. I'm guessing that you intend to run the public void main(String[] args) function from a class called Start. Make sure that file exists in your project.
 
Ahmed hosni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

run:
java.lang.NullPointerException
at DisplayAuthors.main(DisplayAuthors.java:44)
Exception in thread "main" java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;
at oracle.sql.converter.CharacterConverterFactoryOGS.make(CharacterConverterFactoryOGS.java:43)
at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:95)
at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:126)
at oracle.sql.CharacterSet.make(CharacterSet.java:448)
at oracle.jdbc.driver.DBConversion.init(DBConversion.java:150)
at oracle.jdbc.driver.DBConversion.<init>(DBConversion.java:111)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1007)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:222)
at DisplayAuthors.main(DisplayAuthors.java:18)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the instructions that come with the jdbc driver. There are extra jars to add to the classpath.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic