Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle DBConnection Problem

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I trying to write DataBase connection for my applicaiton i am getting error like <identifier> expected ...and i am pasting my code here please chek it and tell what is the problem.
 
Evgeniy Bulanov
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the details of the problem ...
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vardhan,
Others may be able to help you using the information provided, but I doubt it.
In order for me to help you, I need to see the actual stack trace you are getting.
Can you post it?
Also it is usually a good idea to also provide relevant details of your environment.
For your question this would include the following:
  • Oracle database version you are using
  • JDBC driver (and version) you are using
  • Java version you are using

  • Your database connection URL includes "localhost".
    Is the database server running on the local host?

    Good Luck,
    Avi.
     
    Reshma Reddy
    Ranch Hand
    Posts: 197
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi thanks for your replys,
    and i am developing my application in JSF, and now also i am getting same error <identifier required>.and my db is running on remotely it need any jar files to support oracle connecter...



    Thanks,
    Vardhan

    [ August 21, 2008: Message edited by: vardhan g ]
    [ August 21, 2008: Message edited by: vardhan g ]
     
    Shailesh Chandra
    Ranch Hand
    Posts: 1082
    Java Oracle Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi vardhan,

    Please refer to AVI's post.

    We will require actual stacktrace of error.



    Are you sure your oracle instance is running on port 8080 ?



    Thanks,
    Shailesh
     
    Jelle Klap
    Bartender
    Posts: 1952
    7
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You might want to try (notice the capital 'C'):


    [ August 21, 2008: Message edited by: Jelle Klap ]
     
    Shailesh Chandra
    Ranch Hand
    Posts: 1082
    Java Oracle Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    can you share the actual reason of the problem, so that it help the other users of forum, who will refer to this post.

    Thanks,
    Shailesh
     
    Reshma Reddy
    Ranch Hand
    Posts: 197
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,
    i worte class.forName insted of Class.forName and one more thing my remote server name what ever i am trining is not correct that is also one porblem. and now i run this file it is showing ClassNotFoundException Exception
    check this ....




    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    compile-single:
    run-main:
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at util.DatabaseConnection.getConnection(DatabaseConnection.java:41)
    at util.DatabaseConnection.main(DatabaseConnection.java:28)
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    connection created successfullynull
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at util.DatabaseConnection.getConnection(DatabaseConnection.java:41)
    at util.DatabaseConnection.main(DatabaseConnection.java:29)
    BUILD SUCCESSFUL (total time: 0 seconds)



    Regards,
    Vardhan.

    [ August 21, 2008: Message edited by: vardhan reddy ]

    [ August 21, 2008: Message edited by: vardhan reddy ]
    [ August 21, 2008: Message edited by: vardhan reddy ]
     
    Jelle Klap
    Bartender
    Posts: 1952
    7
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You should take a look at the Oracle JDBC FAQ. Particularly the sections on installing the Thin driver and the form of the connection URL.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic