Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Oracle Driver Prob, JDBC

  • 22-03-2006 6:42pm
    #1
    Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭


    NB: those smiley face aren't ment to be there!
    Connection conn;
    OrackeDriver driver;
    Statement stmt;
    String url = "jdbc:oracle:oci:@global1";
    driver = new oracle.jdbc.driver.OracleDriver();
    DriverManager.registerDriver(driver);
    conn = DriverManager.getConnection(url, "username",
    "password");

    this is the code but i get this error:
    C:\Tomcat\webapps\site\WEB-INF\classes\User\UserData.java:13: <identifier> expected
    driver = new oracle.jdbc.driver.OracleDriver();
    ^
    1 error
    from this line:
    driver = new oracle.jdbc.driver.OracleDriver();


Comments

  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    Got it, it was teo things for people that may get this problem:
    1) Spelling:
    its
    OracleDriver driver;
    not
    OrackeDriver driver;
    2) method:
    These lines of code must be within a method and should also be within a try catch block.

    driver = new oracle.jdbc.driver.OracleDriver();
    DriverManager.registerDriver(driver);
    conn = DriverManager.getConnection(url, "username", "password");


Advertisement