JSP - access database

Hi,
I�m making a application JSP, but I have problems with the access for Database (Sybase SQL Anywhere). Somebody will can help me as to make this access? I have used connection jdbc.odbc.
Thanks for all and sorry my English.

You need the appropriate JDBC driver. The database is unlikely to be set up as an ODBC data source, and you don't want it to be anyway.
And don't access the DB from the JSP. That's a task for the model/business part of your app, not for the final representation of a set of data.

Similar Messages

  • How to use taglibs in JSP for Database access

    Hi
    Could any one please tell me how to use taglibs in JSP for Database access
    with regrds
    Jojo

    This is a sample how to connect to a MySQL database with JSTL 1.0:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>JSTL MySQL</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <c:catch var="e">
    <sql:setDataSource var="datasource" url="jdbc:mysql://Your_Server_Name_Here/You_Schema_Here"
                           user="Your_Username_Here" password="Your_Password_Here"
                           driver="com.mysql.jdbc.Driver"/>
    <c:out value="datasource= ${datasource},  Class = ${driver.class}"/>
    <br />
    <br />
    <sql:query var="deejays" dataSource="${datasource}">SELECT * FROM Your_Table_Name_Here</sql:query>
    <table>
    <%-- Get the column names for the header of the table --%>
    <c:forEach var="columnName" items="${deejays.columnNames}"><th><c:out value="${columnName}"/></th></c:forEach>
    <tbody>
    <%-- Get the value of each column while iterating over rows --%>
    <c:forEach var="row" items="${deejays.rows}">
      <tr><c:forEach var="column" items="${row}">
            <td><c:out value="${column.value}"/></td>
          </c:forEach>
      </tr>
    </c:forEach>
    </tbody>
    </table>
    </c:catch>
    <br />
    <br />
    <c:if test="${e!=null}"><span class="error">Error</span>�
      <c:out value="${e}" />
    </c:if>
    </body>
    </html>And this thread might help you:
    http://forum.java.sun.com/thread.jspa?threadID=639471&tstart=44

  • JSP with Access Database

    Could I use Access Database in JSP source code without Having DSN (DSN-less)
    I mean i do not want to set up a DSN in Control panel.
    I want only give JSP code a access database (.mdb)
    Please tell me the Connection String.
    Thank you

    try the following code:
    String url = System.getProperty("user.dir")+"\\db1.mdb";
    String conStr = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+url;
    try{
    System.out.println(conStr);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(conStr);
    JOptionPane.showMessageDialog(this,"connection created");
    }catch(Exception e){System.out.println("Error : "+e);}
    where db1.mdb is the database to be used in application
    find this code working let me ack. at [email protected]

  • Uploading images in access database using jsp

    Hi, am using jsp with access database and want to upload as in a profile picture for any profile on the site[i mean depending on the user's convenience] ..
    I just have a code which helps select the image from the client's machine n gets its address..but then how to use it in a form or something so that it can be submitted and inserted in the database?
    Any idea? I d prefer not using servelet.. but if it just cannot be done without servelet then ok can suggest with that too.
    Here is the code of Browsing to obtain the picture:
    <form name=uploadForm action="uploadpic.jsp" method=post enctype="multipart/form-data" >     <input type="file" > <input type="submit" name="submit"  />     </form>

    silversurface wrote:
    Hi, am using jsp with access database and want to upload as in a profile picture for any profile on the site[i mean depending on the user's convenience] ..
    bad. Don't put business logic in JSP, and that includes accessing databases.
    Any idea? I d prefer not using servelet.. but if it just cannot be done without servelet then ok can suggest with that too.
    Don't put business logic in JSP. That's what servlets are for (and EJB).

  • Using MS-Access database in JSP application

    Hi, all. I am new in JSP world. I have an Access database and I�d like to access it in my JSP Application.
    Does anybody know I could do this?
    TIA
    Fernando

    Define your database as an ODBC source and then use the JDBC/ODBC bridge. It's actually only a few lines of code - see http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html

  • Using JSP to connect to an Access Database

    I need help on using JSP to connect to an Access database.
    This is the code I currently have connecting to a mySQL DB. I need to change it to connect to an Access DB. The reason I am switching DB's is because mySQL is no longer going to be carried by my host.
    Here is the code:
    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String UId;
    String FName;
    String LName;
    // define database parameters
    String host="localhost";
    String user="us867";
    String pass="jsf84d";
    String db="db876";
    String conn;
    %>
    <table border="2" cellspacing="2" cellpadding="5">
    <tr>
    <td><b>Owner</b></td>
    <td><b>First name</b></td>
    <td><b>Last name</b></td>
    </tr>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
    pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT uid, fname, lname FROM abook";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
         while(SQLResult.next())
              UId = SQLResult.getString("uid");
              FName = SQLResult.getString("fname");
              LName = SQLResult.getString("lname");
              out.println("<tr><td>" + UId + "</td><td>" + FName + "</td><td>" + LName
    + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </table>
    </body>
    </html>
    Thank You,
    Josh

    <%@ page language="java"%>
    <html>
    <head>
    <title>
    First Bean
    </title>
    <%@ page import="java.sql.*" %>
    </head>
    <body>
    <p>
    <%!
    Connection con;
    Statement st;
    ResultSet rs;
    String userid;
    String password;
    %>
    <%!public void db(JspWriter out)
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:phani");
    catch(Exception e){}
    try{
    st=con.createStatement();
    rs=st.executeQuery("SELECT * FROM login");
    while(rs.next())
    userid=rs.getString("userid");
    password=rs.getString("password");
    out.println(userid);
    out.println("</br>");
    out.println(password);
         out.println("</br>");     
    }catch(Exception e){}
    try{
    con.close();
    }catch(Exception e){}
    %>
    <%db(out);%>
    </p>
    </body>
    </html>
    phani is dsn name
    login is table name
    Good luck
    phani

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

  • SQLException while accessing an MS Access database from a JSP

    I have a set of classes for accessing an MS Access database and have set up the database properly(System dsn...etc).These work fine when im using them from a console application....but when im tryng to use these from a jsp im getting an SQL general exception(Error code: 0).Really caught up here.please help.
    Im using jdk 1.6 and tomcat 6.0 and ms access 2000.
    Edited by: Sayantan_Auddy on Oct 15, 2008 12:56 AM

    I have a set of classes for accessing an MS Access database and have set up the database properly(System dsn...etc).These work fine when im using them from a console application....but when im tryng to use these from a jsp im getting an SQL general exception(Error code: 0).Really caught up here.please help.
    Im using jdk 1.6 and tomcat 6.0 and ms access 2000.
    Edited by: Sayantan_Auddy on Oct 15, 2008 12:56 AM

  • Access of ms access database and displaying it on applets

    I had made the connection thru JDBC and was able to access data from MS Access database when i had written java application program. But when i created one applet and created instance of that class which was making connection to the database thru JDBC and called one method which was returning one value from the database , i was not able to get on the applet(in the text field) . It gave me some security exception saying acces is not allowed.
    Please give me the reason for this and send me reply back on this email id
    [email protected]

    Welcome to the club. There is an on-going discussion from which I too would like to learn this. Try http://forum.java.sun.com/thread.jsp?forum=31&thread=174953.
    Best Wishes.

  • Using JavaScript to access Database

    Hi all,
    I am using JSP and Tomcat for my web application.
    Now i need to use Javascript to access the MS Access database. Can anyone please tell me the class and command for accessing database from javascript.
    Please give me an example and that will help me. I know it is not good to access database using JavaScript. But in this situation i have to use it anyhow.
    Thatnks

    Hi all,
    Thanks very much for your help. Now some of you said that it is not possible in JSP to access database using JavaScript, some of you said yes it is possible but not secure, I understand the both concepts.
    Now my problem is last year i built a web application for my company and the scenario is like this:
    The staff records their working time in that application. Now when they click a button it creates a drop down list of all clients they have and that list is in HTML as SELECT TAG. So the select tag includes 100+ client name.
    Now they can add as many client as they want for example if i have worked with 10 clients i will create 10 drop down list by pressing button called ADD CLIENT and will record their hours.
    Now from the description above you guys can understand that an OnClick Javascript event in involved to create multiple dropdown list.
    Now what i want is that i want those 100+ client list to come from database rather than typing them in the SELECT TAG. and please remember the SELECT tag is implemented in Javascript using innerHTML event.
    Now for those of you who suggested that it is not possible to use Javascript in accessing database, can you please tell me how can i implement Onclick event using JSP/Serverlet and can create dynamic drop downlist?
    Thanks for your time to read this long message.

  • Problem in connecting to Access Database.

    Hi,
         I am new to this Java/JSP Concepts. I am using IBM Websphere Studio(Application Developer 5.1.2). I am facing a problem to connect to the Access database. I have written a java file to connect to the Access Database. When i compile my java code and run it. It was working fine and i am able to insert into the Access database.The java file is working fine without errors. But when i create an object in the jsp and called the methods through that object i am getting "java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver", "java.sql.SQLException: No suitable driver", "java.lang.NullPointerExceptionexceptions" exceptions.
    Please help me in solving the problem.
         My Java code is :
    package myPack;
    import javax.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class DB_Connect {
         private Connection con;
         private Driver driver;
         //private String connectStr ="jdbc:odbc:MS Access Database;DBQ=C:\\Movie_Club.mdb";
         public void initialiseDrivers(){
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   System.out.println("driver found");
              catch (ClassNotFoundException e){
                   e.printStackTrace();
                   System.out.println("driver not found");
              try{
                   con = DriverManager.getConnection("jdbc:odbc:MS Access Database;DBQ=C:\\Movie_Club.mdb","","");
                   System.out.println("database found");
    //"jdbc:odbc:MS Access Database;DBQ=C:\\156761\\Movie_Club.mdb");
    //"jdbc:odbc:MC","",""); I have tried with both of them they are working.
              catch (SQLException ce){
                   ce.printStackTrace();
                   System.out.println("database not found");
         public int insertDB(String empno, String empname, String action, String adventure, String animation, String comedy, String horror, String romantic, String thriller, String sci_fic) throws SQLException {
              int i=0;
              Statement stmt = null;
              try {
                   if(!con.equals(null))
              stmt = con.createStatement();
              i = stmt.executeUpdate("insert into Movie_Flavour values("+empno+","+empname+","+action+","+adventure+","+animation+","+comedy+","+horror+","+romantic+","+thriller+","+sci_fic+")");
              stmt.close();
              con.close();
                   else
                   System.out.println("con not made");
              catch (java.sql.SQLException exception) {
              exception.printStackTrace();
              return i;
         public ResultSet getDetails(){
              Statement stmt = null;
              ResultSet rs = null;
              try{
                   stmt = con.createStatement();
                   rs = stmt.executeQuery("select * from Movie_Flavour where empno = 1");
              catch(Exception e){
                   e.printStackTrace();
              return rs;
         public static void main(String[] args) {
              int i=0;
              DB_Connect db = new DB_Connect();
              try{
                   db.initialiseDrivers();
                   i = db.insertDB("1","2","3","4","5","6","7","8","9","10");
                   System.out.println(i);
              catch(Exception e){
                   e.printStackTrace();
    and my JSP code is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ page import="myPack.DB_Connect" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="javax.sql.*" %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <TITLE>User_Input</TITLE>
    </HEAD>
    <BODY>
    <%
         DB_Connect db = new DB_Connect();
         try
              db.initialiseDrivers();
              db.insertDB("1","1","1","1","1","1","1","1","1","1");
         catch(Exception e)
              e.printStackTrace();
    %>
    </BODY>
    </HTML>
    Websphere shows the following messages in the console.
    [3/1/06 16:35:27:986 IST] 57687dab WebGroup I SRVE0180I: [RTSC_MCWeb] [RTSC_MCWeb] [Servlet.LOG]: /User_Input.jsp: init
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:390)
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:300)
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
    [3/1/06 16:35:28:002 IST] 57687dab SystemErr R      at java.lang.Class.forName1(Native Method)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at java.lang.Class.forName(Class.java(Compiled Code))
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at myPack.DB_Connect.initialiseDrivers(DB_Connect.java:28)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:126)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:049 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:064 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)[3/1/06 16:35:28:111 IST] 57687dab SystemOut O driver not found
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R java.sql.SQLException: No suitable driver
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at java.sql.DriverManager.getConnection(DriverManager.java:558)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at java.sql.DriverManager.getConnection(DriverManager.java:188)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at myPack.DB_Connect.initialiseDrivers(DB_Connect.java:38)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:126)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:111 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:127 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    [3/1/06 16:35:28:127 IST] 57687dab SystemOut O database not found
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R java.lang.NullPointerException
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at myPack.DB_Connect.insertDB(DB_Connect.java:54)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at org.apache.jsp._User_5F_Input._jspService(_User_5F_Input.java:127)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:669)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:767)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    [3/1/06 16:35:28:143 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    [3/1/06 16:35:28:158 IST] 57687dab SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)

    Check if the OdbcDriver is in the classpath

  • Need access levels to access database

    hi ,
    i am doing project with jsp in ms-access database. this webapplication should be accessible to 10 people. all should be view the data but levels should be there.how can i get the access levels to the database like reading access to some 2 people. writing and modifying access to some 5 people.inserting can be done by other 2 people . please give the solution for this. i have netbeans4.1 ide , and tomcat bundled server.
    so, kindly give the jsp code and msaccess solution.
    thanks .

    I am not informed if the ms-access DB supports SQL-92. In that case you should be able to define the users and set the rules using GRANT sql command. So it is more or less an off topic entry here for a java forum.
    Else if you try to implement the authoization business logic out of your DB domain in java (or C or whatever), it is no more coupled with the DB and most likely that is not what you are supposed to deliver.

  • Caonnecting ms access database through tomcat5.5 query

    Hi,
    I have installed tomcat5.5 and jdk1.6 on my machine which has Windows server2003 as OS.
    I'm not able to clearly underdstand the steps in tomcat docs for connecting to database and the changes to be made in different files.
    Can someone tell me detailed and clear steps for connecting to an ms access database through jsp?
    Thanks in advance for your suggestions.

    I'm not exactly sure why you have this problem. I know that the Microsoft SQL Server driver has a parameter "readOnly=false". Check your DB2 docs to see if you need to set a flag like that, too.
    Maybe it has to do with transactions and auto commit. See if DB2 assumes autoCommit true or false. Maybe you have to explicitly commit your INSERT.
    Maybe you're writing to one database and opening another. Make sure that's correct.
    There are other suggestions that I'll offer.
    You do all that work with a database in a constructor? Bad idea.
    You've got database and UI stuff all mingled together. Ever heard of MVC separation?
    Be object-oriented - start by designing an object to encapsulate all those items you're trying to INSERT.
    Then write a Data Access Object (DAO) that does CRUD operations for that object. Test these thoroughly, preferrably with JUnit, until they're 100% perfect.
    Then have a separate UI that instantiates these objects and calls their methods. The persistence layer shouldn't know about UI stuff, and the UI shouldn't need to have any persistence code in it.
    %

  • Beginning Programmer needs help - JSP and databases?

    1. I have never used JSP before, but have been given an assignment to create a webpage to query a database. The database is in Access. Does anyone have a snipet of code in JSP that will query an MS Access database. Is there a function that I can use and pass it an SQL (select statement) and have it return a list of results.
    -OR-
    If there is a way for JSP to transform the MS Access database into a text file that would be good also.
    2. Has anyone created a search functionaly using JSP (or know of a tool) that can search documents, PDF files, HTML files, etc.
    Thank you for any help!

    hi , there is no big deal in JSPs, Servlets, EJBs e.t.c its olnly a matter of committing time and getting urself familar and in areas where you have problems this forum is a nice place for you to share all what u have.
    to start with i will give you some sites where you can start learning jsps, servlets, ejbs and the rest.
    1) http://java.sun.com/j2ee -> look for JSPs , Servlets, EJB, JavaBeans e.t.c
    2) http://www.jspinsider.com
    3) http://www.coreservlets.com
    4) http://www.jakarta.apache.com (download tomcat for your container)
    for databases u can use this code snippet but u will have to read more about databases to be able to chagne some things in this snipper such as your database username, password , url and the rest.
         <%@page import="java.sql.*" %>
         try
            Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con = DriverManager.getConnection ("jdbc:odbc:test_dsn", "sa", "");
         Statement stat = con.createStatement ();
         ResultSet res = stat.executeQuery("select * from authors");
         while (res.next())
              //process the results of this query
         catch (Exception e)
            //process this also
    %>
    You will need to become farmilar with the java programming language and also database conventions so you have a proper understanding.
    study those db codes and modify to suit your needs.
    buzz on me in case you are stuck.
    Regards

  • Replication of MS Access database

    Is this possible to replicate an MS Access database (.mdb) file using Java?.
    I want to do this either in JSP or Servlet.
    Please provide any resource links.
    This is quite urgent.
    Thanks in advance.

    please don't cross-post
    http://forum.java.sun.com/thread.jsp?forum=54&thread=344531
    do you want to make a copy of an Access database? Or do you want to synchronize two (or more) databases? Either way, if your options are JSP or Servlet (pretty much the same things, really), use a straight servlet, no need to throw in HTML. As for the actual mechanics of your replication, it depends on what you want to do.
    Lee

Maybe you are looking for

  • How can I generate a text list of the library?

    I'd like to know how to generate a simple Artist - Album text list of my iTunes library. I'm curious why this hasn't already been added as a feature? The export library command is not what I'm looking for. I just want something that generates a .txt

  • How to preserve and keep 2 Pantones from Illustrator, via Photoshop, to InDesign?

    Ciao! I have designed a 3D illustration in Illustrator (version 15.0.2), this illustration need to be printed for a magazine cover and I want to use 2 pantone colours for it. The 2 pantone colours are assigned form the Swatch Palette. The image is in

  • Another jsp debug question

    I now of the technique to use a script (javac -g $*) as the           weblogic.jsp.compileCommand context-param name in a web application but           this does not appear to be working on WL 5.1 sp6 on linux           The following error message oc

  • Validating components even with autosubmit and immediate

    Greetings: I am working in a application using ADF 11g. In my page, I have a <af:selectOneRadio> with two options (selectItem). These selectItem's have both immediate and autoSubmit attributes equal to true. Next, there is a <af:panelGroupLayout> whi

  • Configure new exchange 2010 while old exchange 2003 running ?

    Hello, I'm in the process of deploying a new fresh installation of SBS 2011/Exchange 2010 server. Currently I have SBS2003/Exchange 2003 running. I want to retired the server and replace with the new server. No migration. By doing that, I am setting