1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

jsp connection problem

Discussion in 'JSP' started by alssadi, Dec 11, 2010.

  1. alssadi

    alssadi Banned

    Joined:
    Dec 11, 2010
    Messages:
    41
    Likes Received:
    3
    Trophy Points:
    0
    Occupation:
    Creative director & web developer
    Location:
    Dubai
    Home Page:
    hey there all,
    im using tomcat 6.0 and im running my codes from Oracle JDeveloper , also im using sqlserver 2005 .

    i will give you guys clue about my problem starting from this code
    Code:
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.text.*" %>
    <%
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    String connectionUrl = "jdbc:sqlserver://localhost:8080;database=HRMP;username=sa;password=hishamalssadi";
    try
    {
    // Load Microsoft JDBC Driver 1.0
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    con = DriverManager.getConnection(connectionUrl);
    System.out.println("connected");
    // Create and execute an SQL statement that returns some data.
    String SQL = "SELECT * FROM employee_pro";
    stmt = con.createStatement();
    rs = stmt.executeQuery(SQL);
    // Iterate through the data in the result set and display it.
    while (rs.next()) {
    System.out.println("result: " + rs.getString(1));
    }
    }
    catch (Exception e) {
    out.print("error="+e);
    }
    finally {
    if (rs != null) try { rs.close(); } catch(Exception e) {}
    if (stmt != null) try { stmt.close(); } catch(Exception e) {}
    if (con != null) try { con.close(); } catch(Exception e) {}
    }
    %>
     
    
    i have included the nessasery libraries in my application project which is :-
    - JSP RUNTIME
    - ORACLE JDBC
    - ORACLE JAVA COMPILER
    - SQLJDBC4.JAR
    - SQLJDBC.JAR

    also i have done the nessasery environment variables

    USER VARIABLES FOR ADMINISTRATOR :-

    - catalina_home ( C:\Program Files\Apache Software Foundation\Tomcat 6.0)
    - classpath ( C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;.;)
    - java_home ( C:\Program Files\Java1\jdk1.2.2 )
    - path ( C:\Program Files\Java1\jdk1.2.2\bin;C:\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu)

    SYSTEM VARIABLES :-
    - path ( C:\Program Files\CA\SC\CAWIN\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\Windows Imaging\;C:\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu;C:\Program Files\Java1\jdk1.2.2\bin;)


    at the end i have configer my ODBC data soruce by adding my specific database to the sql server .

    when i run the code in oracle JDeveloper i get this error:-

    HTML:
    [b]500 Internal Server Error[/b]
     
    oracle.classloader.util.AnnotatedClassFormatError: Bad version number in .class file
          Invalid class: com.microsoft.sqlserver.jdbc.SQLServerDriver
                 Loader: current-workspace-app.web.Application3-Project1-webapp:0.0.0
            Code-Source: /C:/Microsoft [URL=http://www.go4expert.com/articles/introduction-sql-server-t34535/]SQL Server[/URL] JDBC Driver 3.0/sqljdbc_3.0/enu/sqljdbc4.jar
          Configuration: <classpath> in C:\mywork\Application3\Project1\public_html
        Dependent class: _newTest
                 Loader: current-workspace-app.web.Application3-Project1-webapp.jsp33422146:0.0.0
            Code-Source: /C:/mywork/Application3/Project1/classes/.jsps/
          Configuration: *.jsp in C:\mywork\Application3\Project1\classes\.jsps
        at oracle.classloader.PolicyClassLoader.findLocalClass (PolicyClassLoader.java:1462) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.SearchPolicy$FindLocal.getClass (SearchPolicy.java:167) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.SearchPolicy.loadClass (SearchPolicy.java:645) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.PolicyClassLoader.askParentForClass (PolicyClassLoader.java:1289) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.SearchPolicy$AskParent.getClass (SearchPolicy.java:68) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1674) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [/C:/jdevstudio10133/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@17332331]
        at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
        at java.lang.Class.forName0 (Native method) [unknown, by unknown]
        at java.lang.Class.forName (Class.java:164) [jre bootstrap, by jre.bootstrap:1.5.0_06]
        at _newTest._jspService (_newTest.java:65) [/C:/mywork/Application3/Project1/classes/.jsps/ (from *.jsp in C:\mywork\Application3\Project1\classes\.jsps), by current-workspace-app.web.Application3-Project1-webapp.jsp33422146:0.0.0]
        at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service (OrionHttpJspPage.java:59) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.jsp.runtimev2.JspPageTable.service (JspPageTable.java:462) [/C:/jdevstudio10133/j2ee/home/lib/ojsp.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.jsp.runtimev2.JspServlet.internalService (JspServlet.java:594) [/C:/jdevstudio10133/j2ee/home/lib/ojsp.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.jsp.runtimev2.JspServlet.service (JspServlet.java:518) [/C:/jdevstudio10133/j2ee/home/lib/ojsp.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at javax.servlet.http.HttpServlet.service (HttpServlet.java:856) [/C:/jdevstudio10133/j2ee/home/lib/servlet.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by api:1.4.0]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke (ServletRequestDispatcher.java:713) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java:370) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java:871) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java:453) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest (HttpRequestHandler.java:221) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:122) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:111) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run (ServerSocketReadHandler.java:260) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java:239) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.oc4j.network.ServerSocketAcceptHandler.access$700 (ServerSocketAcceptHandler.java:34) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run (ServerSocketAcceptHandler.java:880) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:298) [/C:/jdevstudio10133/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in C:\jdevstudio10133\j2ee\home\oc4j.jar), by oc4j:10.1.3]
        at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]
     
    

    i realy need help from all the expert , or any direction will be helpfull

    regards
     
  2. alssadi

    alssadi Banned

    Joined:
    Dec 11, 2010
    Messages:
    41
    Likes Received:
    3
    Trophy Points:
    0
    Occupation:
    Creative director & web developer
    Location:
    Dubai
    Home Page:
    i guss there is no one to answer my question
     

Share This Page