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.

Similar Messages

  • 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

  • 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 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

  • Gateway elements and a SQL database connection

    Hello,
    I've been running into some rather strange activity with a process I created. My process has multiple gateway elements in it, to allow for multiple people to review and comment on a form throughout the process. I have run this process through on my own machine (this has your normal turnkey install on it), a Development server (set up on a VM), and a Production server (server 2003). Both the dev and production servers are set up to point to a SQL database. My turnkey install points to mysql that was installed as part of the turnkey installation. The process runs correctly on my turnkey install, but not on either of the two server installs. On the two servers where the process fails the process will do one of two things when it gets to a gateway. First it may run through all the branches as expected. Or it may decide not to run through a single or multiple branches. The process itself does not stall, nor does any single task show as stalled. When I review the process in the process management module in adminui, the process seems to be missing tasks when the process fails to execute properly. When I review the jBoss logs, I receive TransactionRolledbackLocalException errors and locking errors when LiveCycle tries to connect with the SQL database. It almost seems like something with the SQL database conncetion isn't allowing for the gateway to function properly. I only seem to be able to reproduce this with the servers that point to a SQL database. Has anyone else experienced anything like this? If so how did you resolve it?

    I am using a WAMP server and Flex3 and I have the same problem.
    I have a table called "reservations" in the MySQL database, with the following fields:
    reserv_id  - int(10)
    date - date
    begin_time - time
    end_time - time
    hours - int(10)
    price - int(10)
    court_id - int(10)
    user_id - int(10)
    When I "create application from database" I also get the message  "Table does not contain any columns.".
    why is it so? I was trying to find some solution in Internet, but didn't found nothing ..

  • Reports 9i R2 Need SQL database connect string

    We have set up REports 9i R2 and can connect to Oracle Database but unabel to find correct connect string to connect to a MS SQL database ?

    You'll need to the JDBC pluggable data source for this - there's no longer any to connect to foreign databases directly through the connect dialog.
    Please take a look at this functionality and ensure that it meets your needs.
    Hope this helps,
    Danny

  • Database connectivity in JSP

    Hi all,
    i am new to JSP and first time trying this code.i am trying to make a connection with the database,there is some problem in SQL.it show me SQLException.
    Here is code connec.jsp:
    <%@ page import="java.sql.*" %>
    <% String name = request.getParameter("name");
    String age = request.getParameter("age");
    %>
    <%
    Connection conn = null;
    Statement stmt = null;
         PreparedStatement pstmt = null;
    ResultSet rs = null;
         try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn = DriverManager.getConnection ("jdbc:odbc:unsoda_project","project_unsoda","project");
         }catch (Exception e) {
              out.println(e);
    %>
    <!-- To read values from the database -->
    <TABLE>
    <%
         try {
              stmt = conn.createStatement();
              rs = stmt.executeQuery("Select codes from code_filter where codes > 1020");
              while(rs.next()) {
    %>
    <TR><TD><!%rs.getInt()%></TD>
    </TR>
    <%
         }catch (Exception e) {
              out.println(e);
    %>     
    </TABLE>
    %>
    When i tried to see the output through web browser it show me Exception:
    /*java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-00913: too many values */
    Now pls. tell me how do i do this connectivity and can diaplay the output of the query into the combo box.
    Thank you,
    sonika

    which of your catch blocks is throwing the exception. From the looks of the message, the ODBC driver is having and argument with the oracle driver based on your query. It says it is wrong. You shouldn't get the error about parameters if your driver doesn't connect, so I don't think that's the problem, I think it is your query.

  • Database connection through JSP

    I am trying to connect JSP to MySql database.
    <body>
    <div id="container">
         <div id="containerleft">
         <!--     <img src="wildfern.jpg" width=200 height=1000> -->
         </div>     
    <div id="containerright"><center><h1>List Of Deliverables</h1></center><br><br>
    <table cellpadding="10">
    <tr>
    <td><h3> Number of Deliverables</h3></td>
    <td><input type="text" name="deliverableSize" size="20" onchange="DynamicBox(deliverableSize.value)"></td>
    <td></td>
    </tr>
    <tr></tr>
    <tr></tr>
    </table>
    <table>
    <tr>
    <td><h3><center>  Week</center></h3></td>
    <td><center><h3>       Deliverable name       </h3></center></td>
    <td></td>
    <td><center><h3>Weightage </h3></center></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    <% 
                              try
                              Class.forName("com.mysql.jdbc.Driver");
                                catch(ClassNotFoundException e)
                                    out.println("Class nai milli bhai");
                                Connection dbh=null;
                               try
                                   dbh=DriverManager.getConnection("jdbc:mysql://172.20.200.21/B2","B2","ignite#1234");         
                                   Statement stmt = dbh.createStatement();
                                    String query = "select * from Parameters_Details;";
                                    ResultSet rs = stmt.executeQuery(query);
                                     while(!rs.next())
                                 %>       
                                 <td><%=rs.getString(2)%> </td>   
                                 <%  
                               }catch (SQLException sqle)
                                    System.out.println("SQL Error : " + sqle);
                               catch(Exception e)
                                   System.out.println("HELLLO"+e);
                               finally
                               //    dbh.closeConnection();
                                %>   
                                   <%--<td></td>
    <td></td>
    <td><center><h3> Core</h3></center></td>
    <td><center><h3>    SE</h3></center></td>
    <td><center><h3>      PE</h3></center></td>--%>
    </tr>
    </table>
    <div id="bottom">
    </div>
    <center> <input type="submit" value="Create" name="Submit">
    <input type="reset" value="Reset" name="Cancel"></center>
    </div>
    </div>
    </form>
    </body>
    It is showing following Exception.
    1>> org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
    2>> java.lang.ClassNotFoundException: org.apache.jsp.DeliverablesList_jsp

    1)<%--<td></td>
    <td></td>
    <td><center><h3>Core</h3></center></td>
    <td><center><h3>SE</h3></center></td>
    <td><center><h3>PE</h3></center></td>--%>
    :- Jasper exception indicates that it seems syntax error . You need to check out your code carefully. Give comments like this
    <% // %> OR <% /* */ %>.
    Or if you wanna comment only html code use <!-- <td> --> like this.
    Second thing why did you write while( !rs.next()) ? it should be while(rs.next())
    Best luck.

  • Error due to accessing database connection using jsp

    Hi,
    I have an error, during accessing a datbase using jsp:useBean from jsp.Urgent i need this one
    my source code is
    DbBean.java
    package SQLBean;
    import java.sql.*;
    import java.io.*;
    public class DbBean implements java.io.Serializable{
    private String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    private Connection dbCon;
    public DbBean(){
    super();
    public boolean connect() throws ClassNotFoundException,SQLException{
    Class.forName(dbDriver);
    dbCon = DriverManager.getConnection("jdbc dbc:mybean","","");
    return true;
    public void close() throws SQLException{
    dbCon.close();
    public ResultSet execSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    ResultSet r = s.executeQuery(sql);
    return (r == null) ? null : r;
    public int updateSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    int r = s.executeUpdate(sql);
    return (r == 0) ? 0 : r;
    database.jsp
    <HTML>
    <HEAD><TITLE>DataBase Search</TITLE></HEAD>
    <BODY>
    <%@ page language="Java" import="java.sql.*" %>
    <jsp:useBean id="db" scope="application" class="SQLBean.DbBean" />
    <jsp:setProperty name="db" property="*" />
    <center>
    <h2> Results from </h2>
    <hr>
    <br><br>
    <table>
    <%
    db.connect();
    ResultSet rs = db.execSQL("select * from employ");
    int i = db.updateSQL("UPDATE employ set fname = 'hello world' where empno='000010'");
    out.println(i);
    %>
    <%
    while(rs.next()) {
    %>
    <%= rs.getString("empno") %>
    <BR>
    <%
    %>
    <BR>
    <%
    db.close();
    %>
    Done
    </table>
    </body>
    </HTML>
    The error like this
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    error: Invalid class file format in C:\Program Files\Apache Tomcat 4.0\webapps\muthu\WEB-INF\classes\SQLBean\DbBean.class. The major.minor version '49.0' is too recent for this tool to understand.
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:65: Class SQLBean.DbBean not found.
    SQLBean.DbBean db = null;
    ^
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:68: Class SQLBean.DbBean not found.
    db= (SQLBean.DbBean)
    ^
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:73: Class SQLBean.DbBean not found.
    db = (SQLBean.DbBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "SQLBean.DbBean");
    ^
    4 errors, 1 warning
    Anybody help me?
    Thanx in advance

    Your code is ok . The problem is in java version witch you use to compile the DbBean class . I think you are using java 1.5 try to change to 1.4 compile and run again should help .

  • Database connection to jsp page

    I have a data entry form in HTML and done validation in javascript.
    From that form the values entered by the user, is displayed on JSP page by method.
    <%=request.getParameter(" ")%
    MY problem is:
    i want that the values shown by the jsp page, is submitted or saved into database automatically, when i click submit button on the page.
    How can i do this.
    I have to use jdbc driver to make a connection for the database.
    plzz help me, as it is very urgent.
    my jsp page is as follow:
    <%@ page language="java" import="java.sql.*" %>
    <html>
    <head>
    <title></title>
    <body>
    <%
    try {
    //Load the jdbc driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //Create a connection object
    Connection con=DriverManager.getConnection("jdbcdbc:jspsql","java","java");
    System.out.println("got connection");
    // Create a statement object and call its executeUpdate method to insert a record
    Statement s=con.createStatement();
    String sql = "INSERT INTO Gl_Mast VALUES ('1','ABHI','120','520')";
    s.executeUpdate(sql);
    // Step 4. Use the same Statement object to obtain a ResultSet object
    sql = "SELECT GL_CODE, GL_DESCR FROM Gl_Mast";
    ResultSet rs = s.executeQuery(sql);
    while (rs.next()) {
    out.println(rs.getString(1) + " " + rs.getString(2) + "<br>");
    rs.close();
    s.close();
    con.close();
    catch (ClassNotFoundException e1) {
    // JDBC driver class not found, print error message to the console
    System.out.println(e1.toString());
    catch (SQLException e2) {
    // Exception when executing java.sql related commands, print error message to the console
    System.out.println(e2.toString());
    catch (Exception e3) {
    // other unexpected exception, print error message to the console
    System.out.println(e3.toString());
    %>
    <form name="display" ACTION="" >
    <table width="100%" border="3">
    <tr>
    <TD COLSPAN=5><center><h3><b><i>GL MASTER INFORMATION</i></b></h3></center></TD>
    </TR>
    <tr>
    <th>Code No.</th>
    <th>Description</th>
    <th>Dr. Amount</th>
    <th>Cr. Amount</th>
    <th>Type</th>
    </tr>
    <tr>
    <td> <%=request.getParameter("code")%></td>
    <td> <%=request.getParameter("Description")%></td>
    <td> <%=request.getParameter("DrAmount")%></td>
    <td> <%=request.getParameter("CrAmount")%> </td>
    <td> <%=request.getParameter("type")%></td>
    </tr>
    </table>
    <p>
    <INPUT TYPE="submit" VALUE="SAVE" >
    <INPUT TYPE="button" VALUE="BACK" onClick="history.go(-1)">
    </body>
    </html>
    thanx..
    abhijit

    X POST

  • 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.

  • Can a full file path be used to open a sql database connection?

    I have a requirement to open an unattached sql server database file with a given path. Can this be done?
    This would be similar to opening a Jet database using the path as the Data Source.  For example, the path might be "C:\MyFolder\MyDatabase.mdf".  I need to put the path in the connection string and open the database.  It would look
    something like the following.
    Provider=SQLOLEDB;Data Source=C:\MyFlolder\MyDatabase.mdf;Itegrated Security=SSPI;
    Rob E.

    I don't think its possible with unattached file.
    http://www.connectionstrings.com/sql-server-2008/
    --Prashanth

  • Sharing Portal database connection with JSP page

    Hi out there,
    I implemented a JSP page as a selection form to be integrated into Oracle Portal. This JSP page contains a 'dynamic' form which needs to send queries to the database also integrated in the Portal.
    For this I am currently using a JDBC connection but I would prefer to use the internal db connection of the Portal System.
    Explanation: The user has to log in to the Portal and after that can call the JSP form. To poulate some comboboxes within this form I need some data from the database and the user does have READING privileges on that database.
    Can anybody tell me how to use the user's login and password (or the established connection) to fetch the needed data from the database OTHER than with a jdbc connection?
    Thanx in advance!
    Cheers,
    Thomas

    sorry. not going to happen. you're running in a completely different environment when running Java on Portal. Portal is running in the database; your Java is running on the application server. your Java code must use JDBC to access any database resources, even if Portal related.
    it is essential that you implement a connection pool on the application server to optimize your database traffic. check out bitmechanic for a very good open source option.
    good luck,
    rich

  • Oracle Database Connection using JSP

    I am attempting to create a simple web app using Oracle 9i and JSP. I am trying to create a connection to my database and do not seem to be having much luck. I have worked with ASP and can find my way around fairly well in that environment, however, JSP seems to be not as closely related as I initially thought. Can anyone point me to a good site that can give a beginner the basics on using this technology. I have been to several sites off of Oracle and Sun, but I seem to be more confused after reading them. With JSP, can I code as I would in ASP i.e JavaScript, etc? I have downloaded and installed the JDBC drivers from Oracle's website, but I receive errors when trying to establish a connection. If there is a site that can explain from the ground up how to set up a connection, I would be very greatful!

    Hi,
    This example uses Interbase, but hopefully you will find it useful anyway -
    http://www.kpi.com.au/interbase/connect.jsp
    Cheers,
    Lars

Maybe you are looking for