Results 1 to 4 of 4

Thread: Need help

  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Unanswered: Need help

    i need help to setup the JDBC with ORacle in JSp still it is giving me the followin error

    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    is there any driver for the JDK for ORACLE
    my code is



    <%@ page language="java" import="java.sql.*" %>

    <%
    String userId = request.getParameter("userId");
    String password = request.getParameter("password");
    String dbpassword = null;

    Connection con=null;
    Statement stat=null;
    ResultSet rs=null;

    try
    {

    Class.forName ("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection("jdbcracleci8:@oracle", "digital", "matl#1");
    // or oci7 @TNSNames_Entry, userid, password



    /*Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    'con = DriverManager.getConnection("jdbcdbc:naveed","digital","matl#1 ");*/

    stat=con.createStatement();
    rs=stat.executeQuery("select * from loginfo Where loginfo_id="+ userId +"' ");
    if (!rs.next())
    out.println("User ID is wrong...");
    rs.next();
    dbpassword=rs.getString("password");
    con.close();
    }
    catch(Exception e)
    {
    //response.sendRedirect("login.jsp?error=1");
    out.println(e.toString() );
    return;
    }

    if (!dbpassword.equals(password))
    {
    //response.sendRedirect("login.jsp?error=1");
    out.println("Password is wrong");
    }
    else
    {
    session=request.getSession(true);

    try
    {
    if(session!=null)
    {
    session.putValue("userId", userId);
    }
    }
    catch(Exception e)
    {
    out.println(e.toString() );
    }

    //out.println("Succss in login");
    response.sendRedirect("user_Login.jsp");
    }
    %>
    any one to help

  2. #2
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171
    check if classes12.zip is present in your classpath.
    Oracle can do wonders !

  3. #3
    Join Date
    Mar 2004
    Posts
    3

    oks

    only to add the patt or to add the ZIp in JDK ot tomact also

  4. #4
    Join Date
    Mar 2004
    Posts
    3

    this Now

    Originally posted by cmasharma
    check if classes12.zip is present in your classpath.
    i am using JDK1.4 and tomact 1.3 here is the Problem now
    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: make_c_state
    org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:682)
    org.apache.jsp.naveed.vali_jsp._jspService(vali_js p.java:114)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:136)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:320)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:293)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:240)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)


    root cause

    java.lang.UnsatisfiedLinkError: make_c_state
    oracle.jdbc.oci8.OCIDBAccess.make_c_state(Native Method)
    oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.jav a:397)
    oracle.jdbc.driver.OracleConnection.(OracleConnect ion.java:346)
    oracle.jdbc.driver.OracleDriver.getConnectionInsta nce(OracleDriver.java:468)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:314)
    java.sql.DriverManager.getConnection(DriverManager .java:512)
    java.sql.DriverManager.getConnection(DriverManager .java:171)
    org.apache.jsp.naveed.vali_jsp._jspService(vali_js p.java:60)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:136)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:320)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:293)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:240)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)


    note The full stack trace of the root cause is available in the Tomcat logs.

    and the class paths are
    ****
    C:\>SET PATH C:\j2sdk1.4.1_02\bin;C:\j2sdk1.4.1_02\jre\lib\ojdb c14.jars
    Path=I:\oracle\ora90\jdk\jre\bin\classic;I:\oracle \ora90\jdk\jre\bin;I:\oracle\o
    ra90\bin;I:\oracle\ora90\jlib;D:\oracle\ora90\bin; C:\Program Files\Oracle\jre\1.
    3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\ WINDOWS;C:\
    WINDOWS\System32\Wbem;C:\j2sdk1.4.1_02\lib\ojdbc14 ;D:\oracle\ora90\jdbc\lib\clas
    ses111.zip;D:\oracle\ora90\jdbc\lib\nls_charset11. zip;D:\oracle\ora90\jdbc\lib\o
    jdbc14.jar;D:\oracle\ora90\jdbc\lib\nls_charset12; C:\j2sdk1.4.1_02\bin;C:\j2sdk1
    .4.1_02\jre\lib\ojdbc14.jars



    iam using thin for the connection
    any one help me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •