MDB & JSP

I am trying one of the examples:
I have a jar file that has MDB class and then I have war file that has jsp that accesses the queue. And jar file and war file is being pacakged in ear file. So my question is that when I deploy .ear does it run in it's own VM. In this example:
1. A.jsp sends message to calculator bean.
2. calculator bean reads the message, does some calculations and add a record to static member of another class RecordBean
3. A.jsp calls B.jsp to display results. And, B.jsp directly accesses the static member of RecordBean.
So my question is that is all that happening in one VM otherwise B.jsp wouldn't have been able to directly access RecordBean. Why is it like that. Please let me know if you want me to post the example.

A static reference to an object instance might be available to all the other object, or not, depending on the class loader hierarchy.
For classes packaged in the same EAR file, they should have no class loader isolation issues, hence your static references should work fine. But for different EARs or different WARs in different EARs or deployed independently, you might end up with class loading issues (this very often depend on your container and the way it interprets/implements J2EE class loading).
You would definitively benefit from reading about core Java knowledge and J2EE as well.

Similar Messages

  • JSP using jdbc to access mdb

    Done ...
    User DSN and System DSN Add. Select Microsoft Access Driver (*.mbd) and data source name is aa
    in JSP ..
    <%@ page import="com.thinweb.sql.*" %>
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection c1 = DriverManager.getConnection("jdbc : odbc : aa","",""); [no spacing]
    Error: 500
    Location: /gone.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: No suitable driver
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:181)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)
    Root cause:
    com.thinweb.sql.SQLException: No suitable driver
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:123)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)

    You must have the JdbcOdbcDriver.class in your classpath.

  • How to access MDB database from JSP Web Application?

    hi
    i am using tomact and developing appplication in which i have to insert data into MDB database and read/Update/Delete Data in MDB DataBase.
    could any help in this issue?
    Thanks
    Regards
    Oersla Afroze Ahmed

    Hi,
    For accessing MDB database, you must have a jdbc:odbc driver, u can get it from sun site.
    just put it into the lib folder of web server.
    or
    just follow the following link:
    http://www.developer.com/db/article.php/3571661
    keshri

  • MS Access and JSP

    I"ll really appreciate if someone could help me here. I'm new to JSP's and am having some trouble with database connection. I have one html page which asks the user to enter three fields and then submit it by clicking on the submite button(which calls add.jsp).
    The add.jsp contains the following code:
    Connection con=null;
    Statement stmt = null;
    ResultSet rs = null;
    String queryText = "insert into networks2 values('";
    queryText = queryText.concat(request.getParameter("SenderName"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageTitle"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageText"));
    queryText = queryText.concat("')");
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:networks2");
    stmt = con.createStatement();
    rs = stmt.executeQuery(queryText);
    } catch (Exception e) {}
    %>
    My problem is that the above data is not being inserted in the database. I have added networks2.mdb driver in system DSn. Could anyone please help me as to why i am not able to add information in my database.
    Thanks.

    Go over to the JDBC forum (which would have been a better place for your question, actually). The question "When I add a record to MS Access, it doesn't show up, why?" is asked frequently there. I think the answer is that it does show up if you continue by doing a select query, but I may be wrong.

  • I have a web service that I am trying to use an MDB with.

    I have a web service where I request using soapUI, and the the response from the soapUI that I get is correct. However, in addition to this "regular" program flow, I am sending data to a queue where 2 things should happen:
    1. my message should get put in that queue....(not a problem I think, it's says it can connect and send to this one)
    2. a MDB should get triggered, but isn't, and the MDB should start it's own program flow after this.
    this is the basics as to what is happening in my program, and I get this error below on the end of the output. so would anyone have any theories as to what might be wrong?
    ApplicationDispatcher[] Servlet.service() for servlet HandlePrecompiledJsp threw exception
    com.sun.enterprise.tools.guiframework.exception.FrameworkException: Unabled to handle pre-compiled JSP '/jsp/LogDetail.jsp'. Expected pre-compiled classname: 'org.apache.jsp.jsp.LogDetail_jsp'.
    at com.sun.enterprise.tools.admingui.servlet.HandlePrecompiledJsp.doPost(HandlePrecompiledJsp.java:59)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
    at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
    at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
    at com.iplanet.jato.view.ViewBeanBase.forward(ViewBeanBase.java:340)
    at com.iplanet.jato.view.ViewBeanBase.forwardTo(ViewBeanBase.java:261)
    at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.execute(DescriptorViewHelper.java:316)
    at com.sun.enterprise.tools.guiframework.view.DescriptorViewBeanBase.execute(DescriptorViewBeanBase.java:192)
    at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest(RequestHandlingViewBase.java:308)
    at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:802)
    at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.java:740)
    Caused by: javax.servlet.ServletException: com.sun.enterprise.tools.guiframework.exception.FrameworkException: java.lang.reflect.InvocationTargetException while attempting to process a 'beginDisplay' event for 'LogDetail'.
    at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:830)
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:763)
    at org.apache.jsp.jsp.LogDetail_jsp._jspService(LogDetail_jsp.java:126)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at com.sun.enterprise.tools.admingui.servlet.HandlePrecompiledJsp.doPost(HandlePrecompiledJsp.java:57)
    ... 67 more
    Lavanya

    You cannot gift to another country at all.

  • Opening and closing database from JSPs

    Hi,
    I have a few web pages with an underlying database, and after some research I seem to have found that accessing this database directly from the JSP is a bad idea. Because of this I have created 2 methods in my JavaBean class to create the database connection and to close the database connection. What I want to have happen is when the user logs in the the site, a database connection is opened by calling the databaseConnection method then once they close the browser the destroyDBConnection is called. How do I go about implementing this approach in my JSPs? thanks for any suggestions
        * Method to create database connection
        public static void dbConnection() {
          try{
              // Step 1: Load the JDBC driver.
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                // Step 2: Establish the connection to the database.
                String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};" +
                        "DBQ=C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5" +
                        "\\webapps\\TheatreDepartment.mdb";
                connection = DriverManager.getConnection(url);
              connection.setAutoCommit(false);
          } catch (SQLException se) {
              System.out.println("SQL Error while connecting to the database : "+
                                  se.toString());
          } /*catch (NamingException ne) {
              System.out.println("Naming exception Error while connecting to the database : "+
                                  ne.toString());
          } */catch (Exception ne) {
              System.out.println("Error while connecting to the database : "+
                                  ne.toString());
        * Destroy the Connection Object.
        public static void destroyDbConnection() throws SQLException {
              if (connection != null || !connection.isClosed() ) {
                connection.close(); // close the connection
      }

    I would suggest you do some more research.
    Take a look into connection pooling.
    Most of the time you do NOT want to give each individual user their own database connection, but rather keep a bunch on hand for people to use.
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

  • MDB behavior on failed deployment

    I have an MDB that is failing due to a user exception when WL first starts up and tries to initialize the free bean pool. WL seems to try twice and then gives up. The console shows that the JMS connection is active, but the Pooled Beans Current Count is zero. No messages are processed from the queue.
    What is the implemented behavior for this scenario. Will the EJB ever recover? Is there a way to specify the number of retries or the time between retries? I'm running WLS 8.1 SP6.

    So what you are saying is that radio and checkboxes don't retain their state when validation fails?
    Checkboxes are always troublesome because of their design. If not selected, they don't submit any value - so you have to specifically unset them.
    My first instinct would be to look at the formbean which you are populating from, and see what (if anything) modifies its values.
    - for originally loading the new user page is it an action or JSP? Does it apply any default values to the form?
    - check the "input" page you redirect to when validation fails. Is it an action or a JSP?
    - is the same form being uses on the newUser jsp and whatever action you are submitting it to?
    - is there a form reset() method?
    My theory is that the "input" page you are redirecting to when validation fails is an action, and it sets some values on the form prior to loading.
    But thats just a guess at this point. Its hard to debug this without a working example. Its been a while since I worked with struts, and never with annotations providing the validation.
    Suggestion for debugging: dump the contents of the form bean at strategic points in the process to see that the values are what you think they should be.
    - running the save action
    - just after validation
    - on the jsp page.
    Hope this helps some,
    evnafets

  • How to get the value in one JSP page to another?

    Hi,
    I have problems in passing the value around in JSP. I have two JSP pages as below:
    test1.jsp
    I try to get the vaule from my textbox by using:
    String strUser = request.getParameter ("strUserName");
    Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).
    test2.jsp
    Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using
    String strUser1 = request.getParameter ("strUser");
    Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.
    Could you please give me some guidance?
    Thanks you very much for any advise you may give me.
    Kimsan

    Hi,
    Thank you very much for your help. It's working fine if i just get a one value to another page, however, i have problem while i pass the value in my loop to another page because i always get the last record. I try with the following code:
    logged_page.jsp
    <html>
    <head>
    <title>Welcome to the online Auction...</title></head>
    <body>
    <%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
    <% try
         String strUsername = request.getParameter("username");
         session.setAttribute("myUserName", strUsername);     
         String strPassword = request.getParameter("password");
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         String strSQL = "SELECT [UserName], [Password] FROM tblUserDetails where [UserName] = ? and [Password] = ?";
         PreparedStatement statement = myConn.prepareStatement(strSQL);
         statement.setString(1, strUsername);
         statement.setString(2, strPassword);
         ResultSet myResult = statement.executeQuery();
         if(myResult.next())
         //out.println("Login Succesful! A record with the given user name and password exists");
         out.print("<center><h1>");
         out.print("Welcome  ");
         out.print(strUsername);
         out.print("</h1></center>");
         out.print("<center>");
         out.print("<BR><BR>");
         out.print("<font font face = Viner Hand ITC size= 5>Products on sales</font>");
         out.print("<BR><BR>");
         Statement myStatement = myConn.createStatement ();
         ResultSet myResult1 = myStatement.executeQuery("SELECT * FROM tblProduct");
         ResultSetMetaData myResultSet = myResult1.getMetaData();
         out.println("<font face=Tahoma>");
         out.print("<table border=1 CELLSPACING=0>");
         out.print("<TR>");
         out.print("<TD width = 200> Item Title");out.print("</TD>");
         out.print("<TD width = 200> Description");out.print("</TD>");
         out.print("<TD width = 200> Current bid");out.print("</TD>");
         out.print("<TD width = 200> Available Time");out.print("</TD>");
         out.print("<TD width = 200> Place Bid");out.print("</TD>");
         out.print("</TR>");
         out.print("</table>");
         while(myResult1.next())
              String strProName = myResult1.getString(1);
              session.setAttribute("myProName", strProName);          
              out.print("<table border=1 CELLSPACING=0>");
              out.print("<TR>");
              out.print("<TD width = 200>");
              out.println(strProName);
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(3));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(2));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(4));
         out.print("</TD>");
         out.print("<TD>");
              out.print("<form action=bid_page.jsp method=post>");
              out.print("<input type=text name=place_bid>");
              out.print("<input type=submit name=okfunc value=Bid>");
              out.print("</TD>");
              out.print("</form>");
              out.print("</TR>");
              out.print("</table>");
              out.println("</font>");
              out.print("</center>");          
         else
              out.print("<center>");
              out.print("Sorry ");
              out.print("<font color = RED size = 5>");
              out.print(strUsername);
              out.print("</font>");
              out.print(" could not be found.");
              out.print("</center>");
         myResult.close();
         statement.close();
         myConn.close();
         catch(SQLException e)
         out.println(e);
    %>
    </body>
    </html>
    bid_page.jsp
    <HTML>
    <HEAD>
    <TITLE>Welcome to the online Auction...</TITLE>
    </HEAD>
    <BODY>
    <%@ page language ="java" import = "java.io.*" import = "java.lang.*" import = "java.sql.*" %>
    <% try
         String thisUserName = (String) session.getAttribute("myUserName");
         String thisProName = (String) session.getAttribute("myProName");
              Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         PreparedStatement myStatement = myConn.prepareStatement("INSERT INTO tblHistory VALUES ('"+thisUserName+"', '"+thisProName+"', '"+request.getParameter("place_bid")+"')");
              myStatement.executeUpdate();
              myConn.commit();
              myStatement.close();
              myConn.close();
              catch(Exception e){}
    %>
    </BODY>
    </HTML>
    When i click on the BID button in the logged_page.jsp then i always get the last record and save into my table and that is not what i want to. i want to get the result on the same row as the BID button that just click and save to my table.
    Could you please advise?
    Thanks you very much for your time and any consideration you may give me.
    Best Regard,
    Kimsan

  • Bean not working in jsp

    OK, maybe I'm oversharing, but I want to be thorough. Note I asked this question a different way using very different code.
    Here's my jsp file - myq.jsp
    <%@ page language="java" import="java.util.*,com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="inq" tagdir="/WEB-INF/tags" %>
    <inq:displayCollection>
    <jsp:attribute name="mgr">Chris Novish</jsp:attribute>
    </inq:displayCollection>Here's displayCollection.tag used by that jsp:
    <%@ tag body-content="scriptless" import="com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ attribute name="mgr" required="true" %>
    <jsp:useBean id="irc" scope="session" class="com.serco.inquire.IrCollection">
      <jsp:setProperty name="irc" property="mgrid" value="${mgr}" />
    </jsp:useBean>
    ${irc.size} | ${irc.mgrid}Here's the java class IrCollection (used as a bean in the tag):
    package com.serco.inquire;
    import java.sql.*;
    import java.util.*;
    public class IrCollection {
         public ArrayList iRecords = new ArrayList<InquireRecord>();
         public int size;
         public String mgrid;
         public irCollection() {
              super();
         public void populateCollection() {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String filename = "inquire.mdb";
                   String database = "jdbc:odbc:Driver={Microsof Access Driver (*.mdb)};DBQ=";
                   database+= filename.trim() + ";DriverID=22;READONLY=true}";
                   Connection con = DriverManager.getConnection( database ,"","");
                   Statement s = con.createStatement();
                   s.execute ("SELECT * FROM inquiries WHERE manager = '" + this.mgrid + "'");
                   ResultSet rs = s.getResultSet();
                   int cur;
                   while (rs.next()) {
                        cur = rs.getRow()-1;
                        InquireRecord localIR = new InquireRecord();
                        int curID = rs.getInt("ID");
                        localIR.setID(curID);
                        String cursub = rs.getString("submitter");
                        localIR.setSubmitter(cursub);
                        this.iRecords.add(cur, localIR);
                   con.close();
                   this.size = iRecords.size();
              catch (Throwable e) {
                   System.out.println(e);
         public int getSize () {
              return this.size;
         public void setMgrid(String datum) {
              this.mgrid = datum;
              this.populateCollection();
         public String getMgrid() {
              return this.mgrid;
    }and here's the InquireRecord java class used by IrCollection:
    package com.serco.inquire;
    public class InquireRecord {
         private int ID;
         private String submitter;
         public InquireRecord() {
              super();
         public InquireRecord(String asubmitter) {
              this.submitter = asubmitter;
         public int getID(){
              return this.ID;
         public void setID(int datum) {
              this.ID = datum;
         public String getSubmitter() {
              return this.submitter;
         public void setSubmitter(String datum) {
              this.submitter = datum;
    }The JSP does this: set the mgr variable, which is passes to the tag, the tag then creates an instance of IrCollection using that mgr variable. (Yes, putting that populateCollection() method call in the setMgrid() method is probably Bad Practice, but it works, usually). The IrCollection objects builds an ArrayList of InquireCollection objects from an Access database. It then sets it's size property based on how many InquireCollection instances it put into the ArrayList. Once that's all done, the tag spits out 2 things: The size property and the mgrid property.
    When I view the JSP, it gives me 0 for the size and Chris Novish for the mgrid.
    I think this could be one of the following:
    *Not finding any matching records of the database
    *Not actually executing the populateCollection() method
    *some how forgetting the information it put into that ArrayList?
    I"m sure there's another possibility, but I don't know.
    Here's what gets me. Here's a test class I made called TestCollection:
    {code}package com.serco.inquire;
    import java.util.*;
    import java.text.*;
    public class TestCollection {
         public static void main(String[] args) {
              IrCollection myCollection = new IrCollection();
              myCollection.setMgrid("Chris Novish");
              System.out.println(myCollection.getSize());
              System.out.println(myCollection.getMgrid());
    }{code}
    if I run that I get a size of 4 and a mgrid of Chris Novish.
    Same data in, and it works as expected.
    So... why won't JSP do it?

    You have defined a session scope for that bean. You have to make sure that the bean is instantiated by this jsp and not earlier. If the bean is located in the session because it was set earlier, then the body tags within useBean are not evaluated.
    Look here - http://java.sun.com/products/jsp/tags/syntaxref.fm14.html#8865
    An easy way to test it would be to change the scope of the bean to request.
    ram.

  • Crystal Report with jsp

    Please help .............................
    <html>
    <head><title>Table Linking Sample</title></head>
    <body>
    <%@ page import= "java.net.*" %>
    <%@ page import= "java.util.Locale" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.lib.Strings" %>
    <%@ page import= " com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.data.* " %>
    <%@ page import= "com.crystaldecisions.report.web.viewer.CrystalReportViewer" %>
    <%
    //Create a report document object
    ReportClientDocument rptDoc = new ReportClientDocument();
    //assume RAS service is running on the same machine as RAS SDK -
    //and attach this report to the local machine
    InetAddress ip = InetAddress.getLocalHost();
    rptDoc.setReportAppServer(ip.getHostName ());
    //instead of opening an existing .rpt, create a new empty report
    rptDoc.newDocument();
    //Create two table objects
    Table tblA = new Table();
    Table tblB = new Table();
    //Create a connection info object and property bag for the connection
    ConnectionInfo ci = new ConnectionInfo();
    PropertyBag pb = new PropertyBag();
    //place all of the database connection information into the property bag
    pb.put(PropertyBagHelper.CONNINFO_DATABASE_DLL, "crdb_odbc.dll");
    pb.put(PropertyBagHelper.CONNINFO_DATABASE_NAME , "jstud.mdb");
    pb.put(PropertyBagHelper.CONNINFO_SERVER_NAME, "localhost");
    pb.put(PropertyBagHelper.CONNINFO_SERVER_TYPE, "ODBC (RDO)");
    //attach the property bag to the connection info object
    ci.setAttributes(pb);
    ci.setUserName("");
    ci.setPassword("");
    ci.setKind(ConnectionInfoKind.SQL);
    //set the names of the tables to be added
    tblA.setName("Customer");
    tblB.setName("Orders");
    //attach the tables to the connection info object
    tblA.setConnectionInfo(ci);
    tblB.setConnectionInfo(ci);
    //Use the Database Controller to add the two tables to the report
    rptDoc.getDatabaseController().addTable(tblA, null);
    rptDoc.getDatabaseController().addTable(tblB, null);
    //retrieve the two tables back from the report document
    IDatabase db = rptDoc.getDatabase();
    Tables tables = db.getTables();
    int tableAindex = tables.findByAlias("Customer");
    int tableBindex = tables.findByAlias("Orders");
    ITable tableAobj = tables.getTable(tableAindex);
    ITable tableBobj = tables.getTable(tableBindex);
    //retrieve the fields from each table,
    //these fields will be needed for linking
    Fields fieldsA = tableAobj.getDataFields();
    Fields fieldsB = tableBobj.getDataFields();
    //Create a new table link object and two strings (arrays of string)
    TableLink tblLink = new TableLink();
    Strings sourceFields = new Strings();
    Strings targetFields = new Strings();
    //Create a single link between tableA and tableB:
    //which linked the customer ID field from Customer Table...
    sourceFields.add("Customer ID");
    //... to the Customer ID field of the Orders Table.
    targetFields.add("Customer ID");
    tblLink.setJoinType(TableJoinType.leftOuterJoin);
    tblLink.setSourceTableAlias("Customer");
    tblLink.setSourceFieldNames(sourceFields);
    tblLink.setTargetTableAlias("Orders");
    tblLink.setTargetFieldNames(targetFields);
    rptDoc.getDatabaseController().addTableLink(tblLink);
    //Find and add the Customer Name field from the customer table to the report's details section
    int fieldIndex = fieldsA.find("Customer Name", FieldDisplayNameType.fieldName, Locale.CANADA );
    IField fieldobjA = fieldsA.getField(fieldIndex);
    //Find and add the Order ID field from the Orders table
    fieldIndex = fieldsB.find("Order ID", FieldDisplayNameType.fieldName, Locale.CANADA);
    IField fieldobjB = fieldsB.getField (fieldIndex);
    rptDoc.getDataDefController().getResultFieldController().add(-1, fieldobjA);
    rptDoc.getDataDefController().getResultFieldController().add(-1, fieldobjB);
    Good coding practice would place the following code in its own page.
    The above code would re-direct to that page, first storing
    the reportSource in a session variable
    //Create a viewer to preview the report with
    CrystalReportViewer tc1 = new CrystalReportViewer();
    tc1.setName("m_Crystal_Report_Viewer");
    tc1.setOwnPage(true);
    tc1.setEnableDrillDown (true);
    //Pass the report to the viewer, and view the report
    IReportSource reportSource = rptDoc.getReportSource();
    tc1.setReportSource(reportSource);
    tc1.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
    %>
    </body>
    </html>
    while i am executing i am getting a exception like.............
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.occa.report.application.ReportClientDocument resolves to a package
    An error occurred at line: 16 in the jsp file: /Crystal.jsp
    Generated servlet error:
    ReportClientDocument cannot be resolved or is not a type
    An error occurred at line: 16 in the jsp file: /Crystal.jsp
    Generated servlet error:
    ReportClientDocument cannot be resolved or is not a type
    please help...............

    Kindly assist me where i can find the these <%@ page import= "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.lib.Strings" %>
    <%@ page import= " com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%@ page import= "com.crystaldecisions.sdk.occa.report.data.* " %>
    <%@ page import= "com.crystaldecisions.report.web.viewer.CrystalReportViewer" %>
    packages?

  • Parsing in Weblogic/jsp doesn't work; application-mode (command-line) works

    Hello-
    Parsing my XML file in Weblogic/jsp doesn't work, whereas it works
    in application-mode... (albeit on two different machines)
    Here are the parameters:
    server1:
    weblogic 6.0
    win2k server
    jre1.3
    my personal machine:
    ***no weblogic***
    win2k server
    jre1.3
    When I run my code as an application (command-line style) on my machine,
    parsing in my xml file works fine, and I can do a root.toString() and it
    dumps out the entire xml file, as desired.
    However, running my code inside weblogic (on server1) in JSP, parsing in
    my file and doing a root.toString() results in the following: [dmui: null]
    (where dmui is my root)
    (even though i'm running it on two different machines, i'm positive its the
    same code (the servers share a mapped drive)...
    So, I think its probably because I'm using a different parser, as
    specified by weblogic? There are no exceptions being thrown. Here's my
    (abbreviated) code, which is called either command line style or in a JSP:
    // Imports
    import org.w3c.dom.*;
    import org.w3c.dom.Document;
    import javax.xml.parsers.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    DocumentBuilderFactory docBuilderFactory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    mDocument = docBuilder.parse (inFile);
    myRoot.toString()
    -END
    Doing a System.getProperty("javax.xml.parsers.DocumentBuilderFactory")
    results in:
    server1 (weblogic/jsp):
    "weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
    my machine (application-mode):
    null
    Does anyone have any ideas about how to get this work? Do I try to set it
    up so that they both use the same parser? Do I change the Weblogic parser?
    If so, to what? And how?
    Am I even close?
    Any help would be appreciated..
    Thanks, Clint
    "[email protected]" <[email protected]> wrote in message
    news:[email protected]...
    No problem, glad you got it worked out :)
    ~Ryan U.
    Jennifer wrote in message <[email protected]>...
    I completely missed setting the property(:-o), foolish mistake. That wasit. Thanks.
    "j.upton" <[email protected]> wrote:
    Jennifer,
    Personally I would get rid of import com.sun.xml.parser.* and use xerces
    which comes with WLS 6.0 now, unless like I said earlier you have a need
    to
    use the sun parser :) Try something like this with your code --I've put
    things to watch for as comments in the code.
    import javax.xml.parsers.*;
    import org.xml.sax.SAXException;
    import org.w3c.dom.*;
    import java.io.FileInputStream;
    public class BasicDOM {
    public BasicDOM (String xmlFile) {
    try{
    FileInputStream inStream;
    Document document;
    /*You must specify a parser for jaxp. You can in a simple view
    think
    of this as being analogous to a driver used by JDBC or JNDI. If you are
    using this in the context of a servlet or JSP and have set an XML
    registry
    with the console this happens automatically. You can also invoke it in
    the
    context of an application on the command line using the -D switch. */
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
    >>>
    "weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    // create a document factory
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    // specify validating or non-validating parser
    dbf.setValidating(true);
    // obtain a factory
    DocumentBuilder db = dbf.newDocumentBuilder();
    // create a document from the factory
    inStream = new FileInputStream(xmlFile);
    document = db.parse(inStream);
    }//try
    catch (Exception e)
    System.out.println("Unexpected exception reading document!"
    +e);
    System.exit (0);
    }//catch
    }//BasicDom
    // Main Method
    public static void main (String[] args) {
    if (args.length < 1)
    System.exit(1); file://or you can be more verbose
    new BasicDOM(args[0]);
    }//class
    =============================================
    That will give you a basic DOM you can manipulate and parse it fromthere.
    BTW this code
    compiled and ran on WLS 6.0 under Windows 2000.
    Let me know if this helped or you still are having trouble.
    ~Ryan U.
    "Jennifer" <[email protected]> wrote in message
    news:[email protected]...
    Actually I included com.sun.xml.parser.* as one last febble attempt toget
    it working.
    And as for source code, I included the code. If I just put that oneline
    of code
    in, including the imports, it fails giving me an error listed above inthe
    subject
    line. Here is the code again:
    package examples.xml.http;
    import javax.xml.parsers.*;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.w3c.dom.*;
    import java.util.*;
    import java.net.*;
    import org.xml.sax.*;
    import java.io.*;
    public class BasicDOM {
    static Document document;
    public BasicDOM (String xmlFile) {
    try {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    } catch (FactoryConfigurationError e){
    System.err.println(e.getException());
    e.printStackTrace();
    // Main Method
    public static void main (String[] args) {
    BasicDOM basicDOM = new BasicDOM (args[0]);

    Hi, Rob
    Does it work in WL9.2?
    It seems I do it exactly as the explained at http://edocs.bea.com/wls/docs81/programming/classloading.html - and it fails :o(.
    I try to run my app.ear with WL9.2 There are 2 components in it: webapp and mdb. The webapp/WEB-INF contains weblogic.xml:
    <weblogic-web-app>
    <container-descriptor>     
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    </weblogic-web-app>
    Mdb is expected to run in the same mode, i.e. to prefer the webapp/WEB-INF/*.jar over the parent Weblogic classloader. To do so I add the weblogic-application.xml to the app.ear!/META-INF:
    <weblogic-application>
    <classloader-structure>
    <module-ref>
    <!-- reminder: this webapp contains
    prefer-web-inf-classes -->
    <module-uri>webapp</module-uri>
    </module-ref>
    <classloader-structure>
    <module-ref>
    <module-uri>mdb.jar</module-uri>
    </module-ref>
    </classloader-structure>
    </classloader-structure>
    </weblogic-application>
    Now, when classloader-structure specified, both webabb and mdb prefer the weblogic root loader as if prefer-web-inf-classes not defined at all.

  • Problem in - JDBC Connection for  MS-Access in JSP

    Hi,
    I am using Three tier Architecture. that is MS-Access as a Database, JAva Web Server as a server and HTML as a frontend.
    I always getting error during the execution of JSP code.
    Coding in JSP:
    <%@ page import="java.sql.*"%>
    <%
    java.sql.Connection con;
    java.sql.PreparedStatement pstmt;
    java.sql.ResultSet rst;
    String sDBQ= application.getRealPath("dem.mdb");
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con=DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+sDBQ);
         pstmt = con.prepareStatement("select * from employee");
         rst = pstmt.executeQuery();
         if (rst.next())
              String s1=rst.getString("EmployeeId");
              String s2=rst.getString("EmployeeName");
              out.println(s1);
              out.println(s2);
    catch(Exception e)
              out.println("Error "+e);
    %>
    I'm getting this error
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
    Please anyone rectify it

    hi
    [Microsoft][ODBC Driver Manager] Data source name(dsn)
    con=DriverManager.getConnection("jdbc:odbc:dsn);
    first you open the control panel --open ODBCdatasource--user dsn--click add--and select MS-Access--click finish--one window is come --type "dsn"--then click ok --ok .then try it it will come.(before you doing program you can set this)

  • Container managed transactions in 9.0.3 (plus AQ JMS/MDB)

    Something for "real programmers", similar to MDB Transaction Exception on OC4J 9.0.4 (MDB Transaction Exception on OC4J 9.0.4) but little bit different. Maybe author of the mentioned thread can find some answers here also.
    We have an MDB accessing AQ in database (this works either with 9i and 8i). MDB receives the message (actually TextMessage), retrieves the content/properties and calls some EJBs making database operations. When we used just the same DataSource for JMS resource provider and SQL operations, everything worked OK. But we need to move one step further - making calls to several databases, some 8i, some might 9i. We were able to start CMT for one DataSource, i. e. configuring OrionCMTDataSource over JDBC ORACLE driver (if you use different DataSource class, message remains stucked in queue and eventually expires. If you don't specify container managed transactions for MDB in ejb-jar.xml, it works with any DataSource class - but message is lost every time exception occurs - not very pleasant situation).
    We are trying to configure DataSources so they provide transactional support while using commit coordinator. There are some documents describing this - in 9iAS Data Sources and JTA, Orion Data Sources and possibly JTA description in 9i database documentation. Both ORACLE documents are very similar. Generally, these are main steps:
    1) configure each data source so they provides CMT support (wrap native driver/data source by OrionCMTDataSource class)
    2) create datasource commit-coordinator database, also using CMT(?)
    3) create user in commit-coordinator database and same in each other database with connect, resource, create session + force any transaction priviledge (since it would commit other users transactions)
    4) create database links from commit-coordinator database to each databases (but... see questions below)
    5) configure commit coordinator so it uses proper data source
    6) add each DB link as a property to data sources
    7) configure data source for JMS
    8) connect JMS resource provider with JMS data source
    9) Start container, send message, etc.
    So far the only result we've got is a trace file in database user dumps and generic "javax.transaction.SystemExeption: Could not commit: error code 29540". User dump occurs in a "remote" database, not the one where commit coordinator resides. If I drop database links, result is the same, so it seems like problem with data source itself. In a dump there is piece of text like this: "FATAL ERROR IN TWO-TASK SERVER: error = 12571" and "ksedmp: internal or fatal error
    Current SQL statement for this session:
    begin dbms_aqin.aq$_dequeue_in( :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29); end; ". I think AQ call is just a coincidence since it is the first one involved in transactions. Down there in HEX part of a dump there is a message about protocol or network error ("probably ORA-28546")
    Here is an example of data source configuration we are using:
    <!-- Passport CMT DataSource -->
    <data-source
    name="PassportDS"
    class="com.evermind.sql.OrionCMTDataSource"
    location="jdbc/PassportDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="int"
    password="int"
    url="jdbc:oracle:thin:@ws18885:1521:ICON"
    inactivity-timeout="30">
    <property name="dblink" value="ICON.WS18885.APPG.COM"/>
    There are some questions pending. Obvious one is if CMT is working or not at all and we should find some different solution (Bean managed transactions or use XA, hmmm). Other one might be that database link has to be "fully-qualified". I'm not sure what it means: using username and password? Using database name along with domain (if any)? So far it seems links are not used anyway.
    We've tried several databases, like 9.2.0.1 and 9.0.3 versions. Result is the same.
    We've tried to use XA data source of ORACLE (oracle.jdbc.xa.client.OracleXADataSource) and OrionCMT data source bound by xa-source-location to it but container gets stucked upon restart with "Investingating resource 'XADataSource PassportXADS' for recovery..." and similar messages for an hour.
    There is an OracleJTADataSource mentioned in several documents, but I cannot find any in jdbc classes - was it deprecated?
    Lies the problem in JMS itself? So far we've been able to use AQ in 8i and 9i and succesfully commit every transaction - provided transaction was local.
    Since XA itself is working I guess problem might be with configuration.
    I will appreciate any opinion on CMT... also, if you have any questions, please ask.
    Myrra

    Hi Per,
    I don't have an answer for you -- sorry {:-( -- only a suggestion (which
    you may have already tried, anyway :-). Have you tried running OC4J
    in "debug" mode? The following web-page gives details on how to do that:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    Also, if you aren't already aware of them, the following web-sites
    may also be helpful (not in any particular order):
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

  • Problem with setRollbackOnly in MDB

    Hello,
              I get the following error when context.setRollbackOnly is called after an
              exception in a MDB......
              the DD is as follows, which is the same as mentioned in the Programming JMS
              documentation......
              <assembly-descriptor>
              <container-transaction>
              <method>
              <ejb-name>exampleMessageDriven1</ejb-name>
              <method-name>onMessage()</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              regards,
              Farhat
              weblogic.transaction.internal.AppSetRollbackOnlyException
              at
              weblogic.transaction.internal.TransactionImpl.setRollbackOnly(Transac
              tionImpl.java:403)
              at
              weblogic.ejb20.internal.BaseEJBContext.setRollbackOnly(BaseEJBContext
              .java:246)
              at
              weblogic.ejb20.internal.MessageDrivenEJBContextImpl.setRollbackOnly(M
              essageDrivenEJBContextImpl.java:52)
              at
              examples.ejb20.message.MessageTraderBean.onMessage(MessageTraderBean.
              java:153)
              at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:92)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1858)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1817)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              --------------- nested within: ------------------
              weblogic.transaction.RollbackException: Unknown reason - with nested
              exception:
              [weblogic.transaction.internal.AppSetRollbackOnlyException]
              at
              weblogic.transaction.internal.TransactionImpl.throwRollbackException(
              TransactionImpl.java:1248)
              at
              weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
              sactionImpl.java:208)
              at
              weblogic.transaction.internal.TransactionManagerImpl.commit(Transacti
              onManagerImpl.java:208)
              at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:106)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1858)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1817)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

    This is standard JMS behavior. Some providers like Bea Weblogic 6.1 allow you to re-direct messages to an error or suspense queue. However, you can always do the same in your code without much difficulty. Simply set a retry counter and compare the number of rollbacks against the retry counter (cache the msg id to be sure you are counting the same message). If your retry counter exceed the no. of rollbacks, simply re-direct the message to a suspense queue. Once the file system is solved, simply re-direct the message back to the original queue. You can have a jsp that does a QueueBrowse on the suspense queue or simply a scheduled process that pulls messages off the suspense queue and forwards it to the original queue.
    Adarsh

  • How to tell JSP for encoding Format??

    Hi all,
    I have following requirements
    1. The user enters data in local language say kannada(indian langauage). The data should be stored in ms-access only in the form of local langauge. Customer dosnt want see some junk values or entity values. His requirement is such that he sometimes changes the data from back end. So he wants data must be stored in local lanuage only.
    2. He can enter english letters also, the storage must be in kannada(i.e local language) converted form.
    3. when he renders the values into JSP, the display can be either in local language or english. Here the focus is to store the data in ms-access in kannada only for both the 1&2 cases.
    What i have done
    I wrote two JSP's
    1. The first JSP has two text fields which accepts two inputs from the user. It encodes the data in unicode and sends the data as a part of URL to the second JSP. I wrote the following code. login.jsp
    <?xml version="1.0" encoding="UTF-8" ?>
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
    </head>
    <!--<body text="blue" bgcolor="#87CEFA" font-family="arial">-->
    <body text="blue" bgcolor="#87CEFA" font-family="chiller">
    <form action="p3.jsp">
    <center>
    <br><br>
    <input type="text" name="name"><br><br>
    <input type="text" name="address">
    <br><br>
    <input type="submit" value="ADD"/>
    </center>
    </form>
    </body>
    </html>
    2. In second JSP i connect to the ms-access data base and execute insert query. After insertion i write select query to render the values. I say to getConnection method that the data going to insert should be in UTF-8 format by using properties parameter got getConnection() method. The following code is p3.jsp
    <%@ page import="java.util.ArrayList" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*" %>
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <html>
    <body text="blue" bgcolor="#87CEFA" font-family="algerian">
    <%System.out.println("Before the filter is executed in JSP*********************************************");
    String name=request.getParameter("name");
    String address=request.getParameter("address");
    %>
    <script>
    alert("<%=request.getParameter("name").trim()%>");
    alert("<%=request.getParameter("address")%>");
    </script>
    <% try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // set this to a MS Access DB you have on your machine
    String filename = "C:/database/db1.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
    // now we can get the connection from the DriverManager
    Properties props = new java.util.Properties();
    props.put("user", "");
    props.put ("password", "");
    props.put ("charSet", "UTF-8");
    props.put("lc_ctype", "UTF-8");
    Connection con = DriverManager.getConnection( database,props);
    ResultSet rs=null;
    Statement statement=null;
    statement = con.createStatement();
    System.out.println("name of the emp$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"+name);
    String query="insert into Table1(name,number1) values(' " name " ' , ' "+ address +" ')";
    String query1="select * from Table1";
    statement.execute(query);
    rs=statement.executeQuery(query1);
    //ArrayList arr=new ArrayList();
    while(rs.next())
    String name1=rs.getString("name");
    %>
    <br>
    <h>The fetched name from the database is<h>
    <br>
    <%=name1%>
    <br>
    <% }
    con.close();
    catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
    System.out.println("After the filter is executed in JSP******************************************");
    %>
    <br><br>
    </body>
    </html>
    The problem am facing
    1. Am not able to store kannada characters in ms-access but while displaying i get local language characters. Physically am not able to see in ms-access. It stores some western europian language.
    Issues
    1. The issues are.. If user wants to enter english data how can i convert those english characters into kannada and store it in ms-access. and from back end all kannada characters into English
    plz suggest me to do the above work. I cannot use oracle. I must use ms-access only.

    My guess is that the requirements are impossible.
    But as a start certainly you should at least verify that you can get the two character sets in there at the same time. I don't suppose that will work, and certainly would be a good demonstration as to why it is impossible.
    You can look at the following bug
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6345277]
    You might look at the only other real MS Access driver which is commercial and java only. It might support it.

Maybe you are looking for

  • Yoga 2 pro continually changes mode while case is closed

    I love my Yoga 2 Pro but there is one thing I've been unable to figure out:  It seems as though the mode (e.g. tent vs. tablet vs. laptop) keeps changing when the case is closed and the computer is moving around. I'll close the lid which, based on my

  • Calling a stored procedure using Oracle Ole Db provider

    I am looking for an example of syntax used to call a stored procedure from VB.Net using the Oracle OleDB provider. I have been using the Microsoft provider MSDAORA but need to move to the Oracle provider due to upgrade. The syntax used with the MSDAO

  • Poor student researcher in desperate need help hooking up an Adam 4017 and 4018m to windows 7 computer!

    Thought I was getting a great deal. Like the loggers. Have them hooked up but I can not link to any program. Grant it I am a novice when it comes to these things. Im a microbiologist looking for bacteria that makes electric not a programmer. I need t

  • Change order of components in FlowPane

    I'm interested how I can change with mouse drag and drop the order of components in FlowPane. I have a example which can work with TabPane and drag tabs between two TabPanes: public class DragPanel {     private static final String TAB_DRAG_KEY = "pa

  • Discrepancy on CSD team agent statistics

    We are using cisco supervisor desktop (CSD) with UCCE and facing discrepancy in calls presented and calls handled for some agent not for all agent. It shows calls presented on agent are less than calls handled by agent. ANy idea what can be reason of