Database Connection Problem, JSP, Tomcat5.5.9, Oracle9i

hi,
Am trying to make database connection using Oracle9i thin driver, what am doing is:
I put classes12.zip and classes12_dms.jar in the classpath and also added these libraries in netbeans library folder.
I make jsp page like this --------
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*, java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing Page</title>
</head>
<body>
<%
String url = "jdbc:oracle:thin:@SERVERNAME:1521:DBNAME";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(url,"scott","tiger");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from person order by name");
%>
<h1>Testing Page</h1><hr>
<table border="1">
<tbody>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
<% while(rs.next()) {%>
<tr>
<td><%= rs.getString(1)%></td>
<td><%= rs.getString(2)%></td>
</tr>
<%
rs.close();
stmt.close();
conn.close();
} catch(ClassNotFoundException CNFEx) {
out.println("<b>Error !</b><br>" + CNFEx.getMessage());
} catch(Exception Ex) {
out.println("<b>Error !</b><br>" + Ex.getMessage());
%>
</tbody>
</table>
</body>
</html>
when I run this page i got this error messages ----
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:138)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
java.lang.NoClassDefFoundError
oracle.jdbc.driver.OracleConnection.createDMSSensors(OracleConnection.java:506)
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:330)
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:485)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
any kind of help is appericiable.
thanks.....

I'd start by checking for a more recent driver version on Oracle's web site.
Or: googling for "createDMSSensors" (the "root cause" in the stack trace) has as the first hit: Re: Java Help Please! HttpServlet doFilter() Exception

Similar Messages

  • Database Connection problem (JSP, Oracle & Tomcat 5.5)

    I am trying connect to Oracle 8 database through JSP and the webserver is Tomcat5.5. The classes.jar file is in the Tomcat5.5\common\lib directory and the path has also been set to mentioned directory. But I am getting exceptions. The code and the error are given below.
    Need help at the earliest.
    Thanks in advance.
    CODE
    Class.forName ("oracle.jdbc.driver.OracleDriver");     
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@insrs013:1521:GCR","BILLING_USER", "BILLING_USER");
    PreparedStatement pstmt = null;
    ResultSet rs = null;     
    pstmt = con.prepareStatement("INSERT INTO PROJECTIP(PROJECTID, PROJECTSERVERNAME, SERVERIP) VALUES(?,?,?)");
    ERROR
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleDriver
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:137)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:127)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:71)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Hope is only the love of life.

    hi,
    FIrst make one thing clear. By classes.jar you mean either classes111.jar or classes12.jar.Right?If not,please check tht.
    Also,u needn't set any classpaths for Tomcat.
    Regards,
    Viswanath.

  • Problem in Oracle Database Connectivity in JSP

    I am having big problem such as Oracle Database connectivity problem
    Following code i am used for database connection. but it throw an exception call class not found exception.
    Pls any one can help me. With a sample code for Oracle Database connection in JSP
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    String url="jdbc:oracle:thin:@172.25.44.54:1521:bbo";
    con = DriverManager.getConnection(url,"user", "user123");
    Thank you

    Well i've never used oracle or their drivers before but i'm presuming that you'd go to oracle.com or something and look for downloads. Otherwise you could goodle for Oracle JDBC drivers. Then just follow the instructions.
    Again i've never used JSP but if you have a manifest file somewhere you'll need to put a class-path: entry in their referecning the jar file with the driver so that it is availble at run-time.
    Wes

  • DATABASE CONNECTIVITY PROBLEM IN JSP

    Hello Friends .
    I am facing problem in database connectivity with JSP . Following is the code .
    <%
    String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
    String databaseURL = accessDBURLPrefix + "db1.mdb" + accessDBURLSuffix;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection con = java.sql.DriverManager.getConnection(databaseURL, "", "");
    out.println("Connection created sucessfully");
    catch(Exception e)
    out.println(e);
    %>
    It gives following output :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
    If I run the code in core java application then it works sucessfully .
    Plz help me to find the solution .
    I am using sun studio Enterprise 8.1
    have stored the access file in web direcotry in the project.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Please use CODE tags when posting code. You are losing some of the plus signs of string concatenation to the forum's formatting beast.
    Preferred solution: Don't use Access as a database. The JDBC-ODBC bridge is always troublesome.
    If you must use Access...
    Well the message is easy enough to understand: it can't find the database db1.mdb.
    You say you put db1.mdb in the web directory. Obviously the computer is not looking there (silly computer for not looking where you put the file)
    So it is up to you to be smart and tell the computer exactly where to go.
    Using application.getRealPath("/db1.mdb") in place of "db1.mdb" will probably work in a JSP.
    String databaseURL = accessDBURLPrefix  + application.getRealPath("/db1.mdb") +  accessDBURLSuffix;cheers,
    evnafets

  • Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem

    Hi,
    I failed to connect Tomcat 5.0.24 with Postgresql
    7.4.2. The files created by me and the changes i had
    made in the existing files are rates.jsp,
    conversionDAO.java, web.xml and server.xml. The error
    message on the top of the rest of it was "The value of
    useBean class attribute converter.conversionDAO is
    invalid". So far I found out that the coding for
    database connectivity purpose in conversionDAO.java
    cause the error. Another thing is Postgresql jdbc
    driver is required to set in the CLASSPATH for the
    java file to access the Postgresql database. I don't
    know where should I put it in Tomcat for web
    application. Anyway, I put it in
    $CATALINA_HOME/shared/lib according the book i
    refered. I do the database connectivity coding refer
    to the Tomcat Kick Start book from Sams Publishing.
    Below are the coding involved, please show me the
    mistake i had made. Thank you.
    ----server.xml----
    <Context path="/database"
    docBase="${catalina.home}/webapps/database" debug="0"
    reload="true">
    <ResourceParams name="jdbc/conversion">
    <parameter>
    <name>username</name>
    <value>myusername</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>mypassword</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>org.postgresql.Driver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:postgresql://localhost/conversion</value>
    </parameter>
    </ResourceParams>
    </Context>
    ----web.xml----
    <servlet>
    <servlet-name>conversionDAO</servlet-name>
    <servlet-class>converters.conversionDAO</servlet-class>
    </servlet>
    <resource-ref>
    <res-ref-name>jdbc/conversion</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    ----conversionDAO.java----
    public conversionDAO() throws SQLException,
    NamingException
    Context init = new InitialContext();
    Context ctx = (Context)
    init.lookup("java:comp/env");
    DataSource ds = (DataSource)
    ctx.lookup("jdbc/conversion");
    con = ds.getConnection();
    select = con.prepareStatement(
    "SELECT rate FROM Exchange WHERE src= ? AND dst =

    Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem (cont.)
    Errors log
    2004-06-06 01:07:53 StandardContext[servlets-examples]SessionListener: contextDestroyed()
    2004-06-06 01:07:53 StandardContext[servlets-examples]ContextListener: contextDestroyed()
    2004-06-06 01:07:53 StandardContext[jsp-examples]SessionListener: contextDestroyed()
    2004-06-06 01:07:53 StandardContext[jsp-examples]ContextListener: contextDestroyed()
    2004-06-06 01:07:59 StandardContext[balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    2004-06-06 01:08:00 StandardContext[jsp-examples]ContextListener: contextInitialized()
    2004-06-06 01:08:00 StandardContext[jsp-examples]SessionListener: contextInitialized()
    2004-06-06 01:08:00 StandardContext[servlets-examples]ContextListener: contextInitialized()
    2004-06-06 01:08:00 StandardContext[servlets-examples]SessionListener: contextInitialized()
    2004-06-06 01:08:01 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: /rates/rates.jsp(5,0) The value for the useBean class attribute converters.conversionDAO is invalid.
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:141)
         at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1217)
         at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         at org.apache.jasper.compiler.Generator.generate(Generator.java:3261)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    ----more----

  • Database connection problem when i try store the values in JTable

    Hi Sir,
    I have a database connection problem when i try to store the data's in a JTable.I think the problem is with in the database connection.I have used 3 vectors here.The database which i have used is
    Access.Where the program is compiling well.But when i run it only the first column heading is printed and error message showing that
    "Invalid Cursor State".I need to solve this problem.pls. do help me.
    I will provide u with the code.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.sql.*;
    public class DataBaseVector extends JPanel
    //Container contentPane=getContentPane();
    JScrollBar jsb = new JScrollBar(JScrollBar.HORIZONTAL);
    JScrollBar jsb1 = new JScrollBar(JScrollBar.VERTICAL);
    Image i1;
    String url="jdbc:odbc:Ananth";
    Vector col=new Vector();
    Vector rows=new Vector();
    Vector rdata=new Vector();
    Connection conn;
    public DataBaseVector()
    //super("JTable With ScrollBars");
    this.setLayout(new BorderLayout());
    UIManager.put("ScrollBar.track",Color.red);
    UIManager.put("ScrollBar.thumb",Color.blue);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    conn=DriverManager.getConnection(url); // Is there any problem here?
    Statement st=conn.createStatement();
    ResultSet rs=st.executeQuery("Select * from AccountMaster");
    // rs is the result set obtained
    ResultSetMetaData rsmd=rs.getMetaData();
    int cols=rsmd.getColumnCount();
    for(int i=1;i<=cols;i++)
    col.addElement(rsmd.getColumnName(i));
    rdata.addElement(rs.getString(i));
    rows.addElement(rdata);
    }catch(Exception e)
         System.out.println("The Error Message was:"+e.getMessage());
    JTable jt=new JTable(rows,col);
    int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    JScrollPane jsp=new JScrollPane(jt,v,h);
    this.add(jsp,BorderLayout.CENTER);
    this.add(jsb, BorderLayout.SOUTH);
    this.add(jsb1, BorderLayout.EAST);
    public static void main(String args[])
    JFrame jf=new JFrame();
    JPanel frame=new DataBaseVector();
    jf.getContentPane().add(frame);
    jf.setSize(800,600);
    jf.setVisible(true);
    Thanx,
    m.ananthu

    The problem is ResultSet.next() is not called.
    Try this and modify the table creation as you need.
    ResultSetMetaData rsmd=rs.getMetaData();
    int cols=rsmd.getColumnCount();
         while(rs.next()) {
              for(int i=1;i<=cols;i++)
                        col.addElement(rsmd.getColumnName(i));
                        rdata.addElement(rs.getString(i));
              rows.addElement(rdata);
    Hope this helps

  • When and How to close database connection in JSP?

    Hi there,
    I am using MySQL and JDBC 3.0, in my system, When and How to close database connection in JSP?
    Thanks in advance.
    Lonely Wolf
    <%@ page session="true" language="java" %>
    <jsp:include page="checkauthorization.jsp" />
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%--
    Execute query, with wildcard characters added to the
    parameter values used in the search criteria
    --%>
    <sql:query var="availablecomputerList" dataSource="jdbc/Bookingcomputer" scope="request">
    SELECT * FROM computer where status=0
    order by s_code
    </sql:query>
    <html>
    <head>
    <title>Search Result</title>
    </head>
    <body bgcolor="white">
    <center>
    <form action="checkin.jsp" method="post">
    <input type="submit" value="Back to Check-in Page">
    </form>
    <c:choose>
    <c:when test="${availablecomputerList.rowCount == 0}">
    Sorry, no available computer found.
    </c:when>
    <c:otherwise>
    The following available computers were found:
    <table border="1">
    <th>Computer</th>
    <th>Description</th>
    <th>Status</th>
    <c:forEach items="${availablecomputerList.rows}" var="row">
    <tr>
    <td><c:out value="${row.s_code}" /></td>
    <td><c:out value="${row.description}" /></td>
    <td><c:out value="${row.status}" /></td>
    </tr>
    </c:forEach>
    </table>
    </c:otherwise>
    </c:choose>
    </center>
    </body>
    </html>

    when should you close the connection? when you're done with it.
    how should you close the connection? like this: conn.close();
    that said, doing this in a JSP page is bad form and not recommended
    JSP's typically don't contain ANY business or data logic

  • How to establish a MYSQL Database connection in JSP page.

    Hi People,
    Tell me how to establish mysql database connection in JSP page.
    Needed details on:
    1) what are all the mysql drivers need to be included.
    2) what is the syntax for establish a database connection

    hi,
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.htmlsee down for mysql config with tomcat

  • Jsp-database connectivity problem

    hi
    There is a problem, when ever i write a jdbc code for database connectivity through MsAcess, in general applications it works fine. But when ever i try to the same using Jsps it throws an exception that " Microsoft jdbc-odbc driver not fount, Default driver not specified"
    please do help regarding this
    the code i used is
    package Products; import java.sql.*;import java.util.*; public class product{          public Vector getCategories()     {          Connection con;          Statement st;          ResultSet rs;          Vector ret=new Vector(1,1);          try          {               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");               con=DriverManager.getConnection("jdbc:odbc:Web");               st=con.createStatement();               rs=st.executeQuery("Select * from Categories");               while(rs.next())               {                         ret.add(rs.getString(2));                    );               }          }          catch(Exception e)          {               //System.out.println("Exception...");               ret.add(e.getMessage());          }          return ret;     }}

    Have you downloaded the driver and put it in your Web-Server?
    In tomcat you simply need to copy the file in:
    Tomcat 5.0\common\lib

  • Database Connection Problem in Oracle9i Lite Web-to-Go

    Hi
    I am having problem in the Database Connectivity. I am using the OracleDriver class for the connection and have defined the DataSource in the struts-config.xml as
    <data-sources>
    <data-source>
    <set-property property="driverClass"
    value="oracle.jdbc.driver.OracleDriver" />
    <set-property property="url"
    value="jdbc:oracle:thin:@192.50.200.201:1521:WEBTOGO.WORLD" />
    <set-property property="maxCount"
    value="5"/>
    <set-property property="minCount"
    value="1"/>
    <set-property property="user"
    value="master"/>
    <set-property property="password"
    value="ramchow"/>
    </data-source>
    </data-sources>
    But when I am trying to do any database transaction it is throwing the following exception..
    log9: [ERROR] ActionServlet - -Initializing application data source org.apache.s
    truts.action.DATA_SOURCE <java.sql.SQLException: Io exception: Connection refuse
    d(DESCRIPTION=(TMP=)(VSNNUM=153093120)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505
    )(EMFI=4))))>java.sql.SQLException: Io exception: Connection refused(DESCRIPTION
    =(TMP=)(VSNNUM=153093120)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:361)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:442)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
    at org.apache.struts.legacy.GenericDataSource.createConnection(GenericDa
    taSource.java:805)
    at org.apache.struts.legacy.GenericDataSource.open(GenericDataSource.jav
    a:741)
    at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionSe
    rvlet.java:1085)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at oracle.lite.web.JupServlet.createInstance(JupServlet.java:349)
    at oracle.lite.web.JupServlet.getServlet(JupServlet.java:322)
    at oracle.lite.web.JupServlet.service(JupServlet.java:216)
    at oracle.lite.web.AppServletHandler.handle(AppServletHandler.java:297)
    at oracle.lite.web.JupApplication.service(JupApplication.java:550)
    at oracle.lite.web.JupHandler.handle(JupHandler.java:109)
    at oracle.lite.web.HTTPServer.process(HTTPServer.java:306)
    at oracle.lite.web.HTTPServer.handleRequest(HTTPServer.java:162)
    at oracle.lite.web.JupServer.handle(JupServer.java:310)
    at oracle.lite.web.SocketListener.process(SocketListener.java:172)
    at oracle.lite.web.SocketListener$ReqHandler.run(SocketListener.java:226
    log9: javax.servlet.UnavailableException: Initializing application data source o
    rg.apache.struts.action.DATA_SOURCE
    log9: at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionSe
    rvlet.java:1091)
    log9: at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
    log9: at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    log9: at oracle.lite.web.JupServlet.createInstance(JupServlet.java:349)
    log9: at oracle.lite.web.JupServlet.getServlet(JupServlet.java:322)
    log9: at oracle.lite.web.JupServlet.service(JupServlet.java:216)
    log9: at oracle.lite.web.AppServletHandler.handle(AppServletHandler.java:297)
    log9: at oracle.lite.web.JupApplication.service(JupApplication.java:550)
    log9: at oracle.lite.web.JupHandler.handle(JupHandler.java:109)
    log9: at oracle.lite.web.HTTPServer.process(HTTPServer.java:306)
    log9: at oracle.lite.web.HTTPServer.handleRequest(HTTPServer.java:162)
    log9: at oracle.lite.web.JupServer.handle(JupServer.java:310)
    log9: at oracle.lite.web.SocketListener.process(SocketListener.java:172)
    log9: at oracle.lite.web.SocketListener$ReqHandler.run(SocketListener.java:226.
    Can anybody guide me what can be the problem asap.
    regards
    ramchow

    Ramesh,
    This looks like it might be a Java class mismatch error. Do you have multiple versions of Java installed on your machine? If so, you may want to keep one version and remove the rest.
    If you're already running just one version, you may want to check the registry and classpath for references to multiple Java versions, or version that no longer exist.
    Please let me know if you have additional questions.
    Junius

  • Database Connection Problem-SQL SERVER 2005

    Dear all,
    I have been struggling with this database connection.I have installed sql server 2005 in my PC and i am trying to connect to the Database Adventity.But it is showing port 1432 invalid.I have placed sqljdbc jar in my lib folder.If i dont specify Database name then it will print hi Message..if i specify Database name then the error will come.
    MY CODE is::
    <%@page import="java.sql.*,java.io.*,java.lang.*,java.util.*,java.util.Vector,bean.*" %>
    <%
              Connection con;
              Statement stmt;
              String url= "jdbc:sqlserver://156.0.11.140:1433/Adventity";
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              con = DriverManager.getConnection(url,"sa","hcl@123");
              stmt = con.createStatement();     
              out.println("hi");
    %>
    THE ERROR IS:
    javax.servlet.ServletException: The port number 1433/Adventity is not valid.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
         org.apache.jsp.adv1_jsp._jspService(adv1_jsp.java:66)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    PLEASE HELP ME TO GET RID OUT FROM THIS PROBLEM.
    THANKS IN ADVANCE.

    hi
    i have given what u said and it is not working but it displays blank page.even i tried to getdate..
    pls help me
    <%@page import="java.sql.*,java.io.*,java.lang.*,java.util.*,java.util.Vector,bean.*" %>
    <%
              Connection con;
              Statement stmt;
              try
              String url= "jdbc:sqlserver://156.0.11.140:1433;databaseName=test";
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              con = DriverManager.getConnection(url,"sa","hcl@123");
              stmt = con.createStatement();
              String user="select getdate();"
              System.out.println(user);
         catch (Exception e) {
                   out.println(e.toString());
              } finally {
                   try {
                   } catch (Exception e) {
                        e.printStackTrace()     ;
    %>

  • Database connection problem java.lang.ArrayIndexOutOfBoundsException

    Hi,
    I am using Interstage server 7 and Oracle 11g for upgradation of project, application compilation is fine, but when I run the application its giving database connection exception.
    Full stack trace like below. JDK version is 1.3. can anybody tell me what may be the problem?
    2010-11-22 15:16:42 - ConnectionPool()
    java.lang.ArrayIndexOutOfBoundsException
         at oracle.security.o3logon.C1.r(C1)
         at oracle.security.o3logon.C1.l(C1)
         at oracle.security.o3logon.C0.c(C0)
         at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
         at oracle.jdbc.ttc7.O3log.<init>(O3log.java:291)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:257)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:307)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
         at java.sql.DriverManager.getConnection(DriverManager.java:512)
         at java.sql.DriverManager.getConnection(DriverManager.java:172)
         at jp.tt.framework.db.DBConnection.getConnection(DBConnection.java:65)
         at jp.tt.framework.db.DBConnection.getConnection(DBConnection.java:88)
         at jp.tt.framework.db.ConnectionPool.<init>(ConnectionPool.java:38)
         at jp.tt.framework.BaseCommon.<clinit>(BaseCommon.java:217)
         at jp.tt.framework.core.Crypt.getInstance(Crypt.java:79)
         at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:53)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:309)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:239)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:362)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:511)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:270)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:412)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:301)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2515)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:249)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:184)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:370)
         at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:137)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:232)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:646)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:436)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:806)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:479)
    Thanks in advance
    Manjunath
    Edited by: 814259 on 2010/11/21 23:47
    Edited by: 814259 on 2010/11/21 23:49

    Thank you for the replies
    The problem got solved. Problem was older version of Oracle driver was placed in WEB-INF/lib and a directory called lbrary(we created it) above WEB-INF, we were placed newer version of driver in oracle's jdbc/lib directory and specified that path in classpath. But by default the older version was prioritized and used by application so we were getting the exception mentioned. When we deleted older version of driver everything got working. This explation may help for those who have similar type of problems.
    Thanks

  • Sql database connection in jsp

    Hi,
    I am new to java.
    I know how to connect the database in the java using the javacodings [jdbc] but i am don't know how to connect the database using the jsp.
    Is it easy. If so, can any one help me in this regards.
    Any sample codes or white paper available.
    thanks in advance,
    Regards,
    sa

    Hi,
    Here's a simple application i write to test JSTL.
    Using JSTL is easier.
    Create a directory named tests in your webapps tomcat directoty.
    In this, create a web-inf dir and inside a lib dir.
    Copy JSTL.JAR ans STANDARD.JAR in tests/web-inf/lib/ which are lib for JSTL (found on apache foundation web site, jakarta implementation).
    Copy you jdbc driver in jakarta-tomcat/common/lib dir.
    Here is a file to input some data from an HTML form:
    Create saisie.jsp and record.jsp in you tests apps dir.
    saisie.jsp:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <title>Simple Example</title>
    </head>
    <body>
        <h1> Saisie de donn�es  </h1>
        <form name="saisie" action="record.jsp" method="get">
            Code :<input type="text" name="code"/>
            Text :<input type="text" name="text"/>
            <input type="submit" name="submit"/>
        </form>
    </body>
    </html>and record.jsp:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ page isELIgnored ="false" %>
    <html>
    <head>
    <title>Simple Example</title>
    </head>
    <body>
    <sql:query var="result"  maxRows="100">
         select * from ess
    </sql:query>
    <table>
         <!-- Affichage de l'ent�te avec le nom des colonnes -->
         <tr>
         <c:forEach var="name" items="${result.columnNames}">
              <th>${name}</th>
         </c:forEach>
         </tr>
         <!-- Affichage des donn�es avec 'rowsByIndex' -->
         <c:forEach var="ligne" items="${result.rowsByIndex}">
         <tr>
              <c:forEach var="valeur" items="${ligne}">
                   <td>${valeur}</td>
              </c:forEach>
         </tr>
         </c:forEach>
    </table>
    <c:set var="code_id" value="${param.code}"/>
    <sql:update>
        INSERT INTO ESS (ID,TEXT) VALUES (?,?)
        <sql:param>${param.code} </sql:param>
        <sql:param>${param.text}</sql:param>
    </sql:update>
    </body>
    </html>Here's web.xml file to create in tests/web-inf dir:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <description>Learning JSTL (or whatever you like</description>
        <context-param>
              <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name>
              <param-value>jdbc:postgresql://127.0.0.1/gihe,org.postgresql.Driver,gihe,****<param-value>
         </context-param> 
    </web-app>web.xml contains the datasource definition, the jdbc driver, the url, user and password.
    saisie.jsp is a standard html file.
    record.jsp use web.xml datasource to connect to the database and use JSTL tag to insert some data.
    more explanations on java sun site.

  • Database connectivity problem with instant client.

    Guys,
    I've installed the Oracle instant client basic and ODBC files in my system.
    But when I create a system DSN and test the connectivity my database connectivity,it fails with
    ORA-12637:Packet receive failed error
    My TNSNAMES reads below:
    ONDSP101.DIGITALINDIASW.NET =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = namesrv1.xy.zz.com)(PORT = 1522))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ONDSP101)
    and my SQLNET as below:
    AUTOMATIC_IPC = OFF
    TRACE_LEVEL_CLIENT = ON
    SQLNET.INBOUND_CONNECT_TIMEOUT=20
    NAMES.DEFAULT_DOMAIN = na.pg.com
    NAME.DEFAULT_ZONE = na.pg.com
    SQLNET.CRYPTO_SEED = "kdg:9yv2$-plo*u6b2x!"
    NAMES.DIRECTORY_PATH = (ONAMES,TNSNAMES)
    NAMES.PREFERRED_SERVERS =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = TCP.xy.zz.com)
    (PROTOCOL = TCP)
    (Host = namesrv1.xy.zz.com)
    (Port = 1522)
    (ADDRESS =
    (COMMUNITY = TCP.xy.zz.com)
    (PROTOCOL = TCP)
    (Host = namesrv2.xy.zz.com)
    (Port = 1522)
    I've placed my TNSNAMES and SQLNET file in the same folder having the instant client files and I've set my TNSADMIN,LD_LIBRARY_PATH and PATH environmental variable to the folder location.
    Note:I'm able to connect to the database using SQLplus.
    Thanks,
    Bhagat

    12637, 00000, "Packet receive failed"
    // *Cause:  A process was unable to receive a packet from another process.
    // Possible causes are:
    // 1. The other process was terminated.
    // 2. The machine on which the other process is running went down.
    // 3. Some other communications error occurred.
    // *Action: If the cause is not obvious, contact Oracle Customer Support.
    These days I very seldom use ODBC for Oracle - most recently it was simply to get Enterprise Architect to "talk" to Oracle. I never used it for my client applications (unlike in the fast distant past), so what I know about ODBC is seriously outdated.
    Even so, a few comments. :-)
    Have you tried creating a user DSN, in case a system DSN somehow works different environment wise?
    The above error description sounds like the original TCP connection was successful (i.e. it is not a host unknown or not reachable error). Subsequent packets seem to fails.
    To confirm, run the listener on namesrv1.xy.zz.com with logging enabled and have a look at the listener.log - does it show a connection being accepted/handled from your PC when you use the ODBC DSN?
    Have you tried the Oracle ODBC drivers? When getting EA connected I had problems (also with Instant Client) and Microsoft ODBC driver for Oracle. Downloaded and installed the Oracle ODBC driver and it worked just fine first time around.
    PS. You should raise this topic on the Instant Client Forum instead.

  • Database Connection Problem on Linux

    I have recently installed Oracle Database on a linux server. The app server that accesses db is JBoss.
    Always, I end up seeing an error "java.sql.SQLException: No more data to read from socket".
    To verify if the problem is with JBoss, I have written a simple stand alone java class to access the db, and ended up with the same error.
    Can anybody help me out ??
    -Aswin.

    This error most likely occurs in applications that
    use a database connections pool. When the application
    checked out a connection that has been timed out or
    has been staled, and used it to connect to the
    database, this error occurs.
    Could also be a result of connection timeout.Yeah! may be it is the result of connection timeout, but I am sure it cannot be realted to connection pool, because to verify if there were any configuration problems on JBoss, we have written a simple java class that directly accesses the database.
    If it is because of connection timeout, how do i fix it ??

Maybe you are looking for

  • When I try to load gmail I get the message "The page isn't redirecting properly"

    I logged out of one gmail account to log into another. The first account was working fine. When trying to load up the second, I got the following message: " The page isn't redirecting properly Firefox has detected that the server is redirecting the r

  • Is this HD compatible with my 'puter?

    Hey all! In the spirit of absolute paranoia, is this drive compatible with my Power Mac G5 2.0GHzer? I won't be setting it up in a RAID, just another drive to throw stuff on. Thanks a bunch in advance! Michael

  • About table info_prog

    Hi, There is the table info_prog in R3 46B,but there is not it in R3 470. is there the other table replace it in r3 470? Do you know? Regards, collysun

  • Can I use the LCDS for... ?

    Hi, I'm a beginner in LCDS. I have a MySQL database for my ordering system. In this database there is a user table and there are some other tables. These tables use foreign keys of user.id. People can register on my sytem (+1 row in a user table). I

  • Can't re-login onto iCloud email

    Had to hard reset my phone and restored it as a 'new iPhone'. But unfortunately it won't let me reach my old icloud email that I had before I reset it, which was my main email. When I try to login under iCloud it says the account has already been add