Servlet-database communication

Hi,
I wrote an simple code for an application in which i will communicate servlet-bussinesslogic-database.I was success in the forward manner but when i am trying to return the values from the database to the servlet i am not able to return the values. Can anyone help me out to get the way.
Note: i am using a simple application where there are no java beans and other stuff...
please help me out....

I'm sorry to ask this type of question, but it is necessary , because i'm a student studying the yea B.Tech , I have one problem that is i'm trying to get the data from data base through servlets , but i can load the driver but the connection is not forming between the servlet container and jdbc container but i have one idea about that ,
i.e. Up to now i tried on the very popular data bases like (Oracle , SQLServer, MySQL,Microsoft Acess)
But one solution i.e. by ignoring the above mentioned , i want to try the database in the form of xml , for this no need to load the drivers and no need to forn the connections , but we must very well about XML , i don't know how to interact with xml through java application, can any body try it once , if it is success please mention it to my id.

Similar Messages

  • Servlet/Applet communication, data limit?

    I have an applet that uses a servlet as a proxy to load/retrieve images from an Oracle database. I have a problem when trying to retrieve images larger than 9-10kb from the database. When using JDBC from a Java Application I don't have any probelms but through the Applet-Servlet configuration I do.
    I use the following code in the Applet:
    URL url =new URL("http","myserver",myport,"/servlet/MyServlet");
    HttpURLConnection imageServletConn = (HttpURLConnection)url.openConnection();
    imageServletConn.setDoInput(true);
              imageServletConn.setDoOutput(true);
              imageServletConn.setUseCaches(false);
    imageServletConn.setDefaultUseCaches (false);
    imageServletConn.setRequestMethod("GET");
    byte buf[] = new byte[imageServletConn.getContentLength()];
    BufferedInputStream instr = new BufferedInputStream(imageServletConn.getInputStream());
    instr.read(buf);
    Image image = Toolkit.getDefaultToolkit().createImage(buf);
    // then code to display the image
    And the following for the Servlet:
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("image/gif");
    byte[] buff = loadImage(); // this method returns a byte array representing the image.
    response.setContentLength(contentLength);//contentLength is the size of the image
    OutputStream os = response.getOutputStream();
    os.write(buff);
    os.close();
    thanks in advance!

    thanks for your replay,
    I tried your suggestion but whatever I do it seems that tha applet only brings the first 5-10k of the image from the servlet. This is the value I get from instr.read() or any other type of read method. The value of bytes is not always the same.
    Now I also have something new. For images greater than 100k or so I get this error:
    java.io.IOException: Broken pipe
         at java.net.SocketOutputStream.socketWrite(Native Method)
         at java.net.SocketOutputStream.socketWrite(Compiled Code)
         at java.net.SocketOutputStream.write(Compiled Code)
         at java.io.BufferedOutputStream.write(Compiled Code)
         at org.apache.jserv.JServConnection$JServOutputStream.write(Compiled Code)
         at java.io.BufferedOutputStream.write(Compiled Code)
         at java.io.FilterOutputStream.write(Compiled Code)
         at interorient.DBProxyServlet.doGet(Compiled Code)
         at javax.servlet.http.HttpServlet.service(Compiled Code)
         at javax.servlet.http.HttpServlet.service(Compiled Code)
         at org.apache.jserv.JServConnection.processRequest(Compiled Code)
         at org.apache.jserv.JServConnection.run(Compiled Code)
         at java.lang.Thread.run(Compiled Code)
    I am using the Oracle Internet application server (ias 9i) which actualy uses the apache web listener.
    It seems that this servlet-applet communication is really unstable. If you have anything that may help me it will be greatly appriciated. You can even e-mail me at [email protected]
    thanks!

  • Error #1015: Database Communication Error

    Hi,
    I am having a WebCTRL application on my infra which is connecting to SQL server 2008 R2.
    On application side, we are frequently getting error messages saying that ,
     Error #1015: Database Communication Error   --   Critical problem occurred (With timings) Reestablished (DBname) database connection.     details: Successfully reconnected to the database
    i dont see any errors on SQL server logs as well as event logs on the server.
    Is it happening because of SQL server ?
    Is there anything i missed to check ? 
    Please help me to solve this issues.
    Regards,
    Vinodh Selvaraj

    Can you check if your database properties set Auto Close to ON , it must be set to OFF
    https://msdn.microsoft.com/en-us/library/bb402929.aspx
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Error on database communication port

    Dear Guru's,
    While installing solman, database communication port 5912 has been used by another instance which was running on the same host. Could any one suggest is it possible to have any other port number other than 5912.
    regards,
    Guna

    Hi,
    Guess you are using DB2?
    try this
    db2set DB2COMM = TCPIP to set the value.
    Suggest you to check database manager configuration parameters once before changing the parameter.
    Feel free to revert back.
    -=-Ragu

  • Database access using servlet MIDlet communication

    Hi all,
    Could anyone please help me?
    I have written a MIDlet connecting to the TOMCAT web server and invokes a Servlet. The Servlet then fetches data (list of names) from MS Sql Server and returns to the MIDlet. Then the MIDlet displays the names in a ChoiceGroup . And MIDlet invokes another servlet to update
    So far everything works well.
    The hard part with this solution is
    1. Servlet has to send the result as delimited strings (with :)
    2. The midlet has to parse the servlet data and extracts the values. this all done through the code only. no routines i used
    3. the url has to have %20 for space otherwise the Connector.open(url) method throws error.
    Can anyone suggest better solutions for this. perhaps easy?
    Regards,
    //Selva

    Ok, so this is the code i use in the MIDlet to post the two parameters, but i can't get them in the servlet. What's wrong?
    HttpConnection c=(HttpConnection)Connector.open(serverURL);
    System.out.println("Connecting");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    dos=c.openDataOutputStream();
    dos.writeUTF("user=" + userName);
    dos.writeUTF("&password=" + password);
    dos.writeUTF("\r\n");
    dos.flush();

  • Servlet -  database connection usage

    Hi
    I am writing a servlet based upon the multi thread model (default in many cases).In the servlet, I go to database 2 or 3 times per request and get data. I have broken down my main method into 4 methods. so method 1 calls method 2 with some params, method 2 calls method 3 etc.
    I am using connection pooling. I am passing the connection object from method 1 to downstream methods. and release the connection only at the end.
    My question is since this servlet can be accessed by multiple threads, is this a good practice of passing connection downstream since a servlet might try to access with a closed connection object. Should I just get connection objects from the pool and release them inside each method.
    thanks

    Hi
    I am writing a servlet based upon the multi thread
    model (default in many cases).In the servlet, I go to
    database 2 or 3 times per request and get data. I have
    broken down my main method into 4 methods. so method 1
    calls method 2 with some params, method 2 calls method
    3 etc.
    I am using connection pooling. I am passing the
    connection object from method 1 to downstream methods.
    and release the connection only at the end.
    My question is since this servlet can be accessed by
    multiple threads, is this a good practice of passing
    connection downstream since a servlet might try to
    access with a closed connection object. Should I just
    get connection objects from the pool and release them
    inside each method.
    thanksIf the Connection is a local variable for the service, doPost, doGet, etc... there isn't any problem with your aproach.
    If it is, then your Connection is shared between all the threads that run concurrently (run througth the servlet).
    Concerning your aproach (and the Connection beeing a local variable), there is no problem in passing it to the next method by parameter because it is the same thread running the code.
    MSB

  • Applet / SQL Database communication

    I am developing an applet that needs to connect to a SQL Database to keep track of a variety of information. I am running into some errors when I try to connect to the database.
    Can anyone tell me the best way for an applet to connect to a SQL database without editing the client's policy file to give permission?
    Any help with this matter would be much appreciated.
    Thanks.

    I am developing an applet that needs to connect to a
    SQL Database to keep track of a variety of
    information. I am running into some errors when I
    try to connect to the database.
    Can anyone tell me the best way for an applet to
    connect to a SQL database without editing the
    client's policy file to give permission?
    Any help with this matter would be much appreciated.
    Thanks.The best way to communicate to the database from an applet is through a servlet. But if you seriously want anybody to decompile your applet code and really fry your db its upto you. I wouldnot communicate directly from an applet to a db its not worthwhile

  • Servlet database query syntax

    Hi,
    I'm trying to add a search function to a servlet.
    I am able to retreive the value of cof_name with the getParameter() method. However when I try to query the database for that value (cof_name) it doesnt work. Can anyone tell me what is wrong with my sql syntax?
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.*;
    import java.sql.*;
    import java.util.*;
    public class Search extends HttpServlet{
       public void doPost(HttpServletRequest request, HttpServletResponse response)
                                       throws ServletException,IOException{
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          System.out.println("MySQL Connect Example.");
          Connection conn = null;
          String url = "jdbc:mysql://localhost:3306/aubrey?";
          String driver = "com.mysql.jdbc.Driver";
          String userName = "Dude1";
          String password = "supersecret";
          Statement st;
          try {
            Class.forName(driver).newInstance();
            conn = DriverManager.getConnection(url,userName,password);
            System.out.println("Connected to the database");
            String  cof_name  = request.getParameter("cof_name");
            String  sup_id  = request.getParameter("sup_id");
            String  price  = request.getParameter("price");
            String query = "select  COF_NAME from COFFEES where COF_NAME like 'cof_name'";
            System.out.println("query " + query);
            st = conn.createStatement();
            ResultSet  rs = st.executeQuery(query);
          out.print("<html><head>");
             out.print("</head><body>");
             out.print("<code><pre>");
             out.print("<font color=green>COF_NAME\tSUP_ID ");
             out.println("\t\tPRICE\tSALES\tTOTAL\n</font>");
         while(rs.next()){
            out.print(rs.getObject("COF_NAME").toString()+"\t");
            out.print(rs.getObject("SUP_ID").toString()+"\t\t");
         out.print(rs.getObject("PRICE").toString()+"\t");
         out.print(rs.getObject("SALES").toString()+"\t");
         out.println(rs.getObject("TOTAL").toString());
            conn.close();
            System.out.println("Disconnected from database");
          } catch (Exception e) {
          e.printStackTrace();
    }Regards
    Aubrey.

    1. Don't put business logic in your servlet. A servlet should just be a dispatcher to a business logic layer that has no idea that it's running in a servlet context.
    2. "Doesn't work" means nothing. You have to provide more details.
    3. You're doing select  COF_NAME from COFFEES where COF_NAME like 'cof_name' Note that 'cof_name' is inside your string literal, so Java will not expand that variable. You'd have to do it as "select  COF_NAME from COFFEES where COF_NAME like '" + cof_name+ "'"4. But even that's not the right way. The right way is to use a PreparedStatement.
    String sql = "select  COF_NAME from COFFEES where COF_NAME like ?";
    PreparedStatement ps = con.prepareStatement(sql);
    ps.setString(1, cof_name);
    ResultSet rs = ps.executeQuery();

  • How do i Create charts using JSP/Servlet & Database

    I have to create charts which shows the graph of stock exchange.
    i have a database that keeps the data for creating charts.
    But i did not know how to create charts using jsp-servlet.
    Any Example might help me to go forward.
    Any help will be really appreciated.
    Please Advice me.

    JFreeChart - You can generate the charts then convert them to image formats (PNG and JPEG) all using the JFreeChart API
    http://www.jfree.org/jfreechart/

  • ACS and Windows 2000 user database communication port

    Could my Windows 2000 SP4 + ACS v3.23 can install any new Windows 2000 service pack ?
    I'm affraid to infect ACS Service.
    So, I want to install firewall on this server to block malicious traffic.
    However, my ACS used external user database Windows 2000 for authentication.
    Who can tell me What protocols or port list they are communication?
    I have to avoid these traffic on my firewall.

    Hi cheng
    I think you can install any servie pack without problem and the SP4 is the latest one for WIN2000 and you server already has this SP
    For your second question you need to specify many protocols according to your active directory config in this link you can find a list of this protocols and the best way is to make debug or logging or use a siniffer to know the exactly protocols flow between your ACS and AD server
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/deploy/confeat/adrepfir.mspx
    Best Regards

  • Servlet Database I/O: How to "lock" a record being updated ?

    Say you have a servlet that displays a list of customers in HTML page, and a button on each customer to click to bring up another page (servlet generated) with the customer info to edit. The customer info is in a database file (could be Access or ORACLE). User makes any changes and clicks a button to update the customer record (with a servlet).
    How do you prevent two users from editing the same customer record at the same time? I do not want to lock the whole file, just a record.
    Any pointers towards info about this subject appreciated.
    Walk Good

    sridharranganathan, does your technique assume that the read operation is locked, so that two users cannot obtain the same value of LockCounter?
    I have some questions relevant to the following code:
    public class theServlet extends HttpServlet
        public void doGet(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
             Helper theHelper = new Helper();
             theHelper.setUser(req.getCookies);
             resp.setContentType("text/html");
                PrintWriter out = new PrintWriter(resp.getOutputStream());
                Connection con = null;
             try
                   SybDriver sybDriver = (SybDriver) Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
                   sybDriver.setVersion(com.sybase.jdbcx.SybDriver.VERSION_5);
                   DriverManager.registerDriver(sybDriver);
                   con = DriverManager.getConnection("jdbc:sybase:Tds:dbsrv1:3520/hospcap", "myuserid", "mypassword");                 if (con != null) {
                  if(theHelper.getUserRecord(con, this)) {
                           //do some stuff
                        else { //do some other stuff }
                        con.close();
                 }catch(Exception e) { //whatever }
                 finally { out.flush(); }
             } //end doGet()
    } //end class
    public class Helper {
        private String user = "";
        private String field1Val= "";
        private String field2Val= "";
        public boolean setUser(Cookie [] cookies) {
         // method gets the user's userid from a cookie and then:
            user = user_id_from_cookie;
       public boolean getUserRecord(Connection con, theServlet serv){
            StringBuffer sb = new StringBuffer();
            Statement stmt = null;
         try {
             //Try to get the user's info:
                stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
             StringBuffer sql = new StringBuffer("SELECT field1, field2 FROM UserRecords WHERE user_id = '" + user + "'");
             ResultSet rs = stmt.executeQuery(sql.toString());
                rs.last();
                int nrows = rs.getRow();
                if(nrows < 1) { //user doesn't have an entry in the table yet.
                 //First, get result set of records with blank userids:
                 sql.replace(0, sql.length(), "SELECT * FROM UserRecords WHERE user_id = '' OR user_id = NULL ORDER BY field1");
              rs = stmt.executeQuery(sql.toString());
                    rs.last();
                    nrows = rs.getRow();
                 if(nrows > 0) {
                     //there ARE some records with null user_id, so assign this user to the first one:
                        rs.first();
                     field1Val = rs.getString("field1").trim();
                     field2Val = rs.getString("field2").trim();
                        //QUESTION: IS IT POSSIBLE THAT TWO USERS/THREADS HAVE THE SAME VALUE OF field1Val AT THIS POINT?
                     sql.replace(0, sql.length(), "UPDATE UserRecords SET user_id = '" + user + "' ");
                     sql.append(" WHERE field1 = '" + field1Val+ "' AND user_id is NULL");
                  con.setAutoCommit(false);
                  //Trying to use transaction isolation to prevent two users from updating the same record.
                  //Does this only work if the users share the connection, con?
                  int level = con.getTransactionIsolation();
                  try {
                      if(con.getMetaData().supportsTransactionIsolationLevel(con.TRANSACTION_READ_COMMITTED)) {
                          con.setTransactionIsolation(con.TRANSACTION_READ_COMMITTED);
                            //SYNCHRONIZE ON SERVLET INSTANCE?
                      //synchronized(serv){
                            nrows = stmt.executeUpdate(sql.toString());
                  }catch(SQLException se) {
                         con.rollback();
                         con.setAutoCommit(true);
                         con.setTransactionIsolation(level);
                         stmt.close();
                         return false;
                     con.commit();
                     con.setAutoCommit(true);
                     con.setTransactionIsolation(level);
                        if(nrows < 1) { //couldn't update the db.
                         stmt.close();
                         return false;
                     else {
                         stmt.close();
                         return true;
                 else { //There aren't any unused records; deal with it.
                     stmt.close();
                     return false;
                else { // the user has an entry in the table
                    rs.first(); //should only be one record for this userid.
                    field1Val = rs.getString("field1").trim();
                    field2Val = rs.getString("field2").trim();
                    stmt.close();
                 return true;
            }catch(SQLException se) {
             //some problem not caught elsewhere
             return false;
       } // end getUserRecord
    } // end class HelperI should say that the UserRecords table now contains about 5000 records (this will grow in increments of 5000), many of which have null user_id. If the value is not null, then it contains a userid. A user can have either zero or one entry in the table.
    Here are my questions regarding the above:
    1. In the servlet, each thread will have its own instance of Helper and of Connection, correct?
    2. I want to ensure that only one thread can update a particular UserRecords table record at a time. In the getUserRecord method, please note the line where field1Val is assigned, just above the capitalized QUESTION comment. Is it possible that two threads could have the same value of field1Val at the same time?
    3. When you set the transaction isolation level for connection1, does that prevent other threads that are using other connections to the database from accessing records being updated by the thread using connection1?
    4. As you can see, I am considering passing a reference to the servlet instance into the getUserRecords method and synchronizing the update statement on the servlet instance. Will that ensure only one thread at a time can update the record, without using the transaction isolation code?
    Thanks in advance for your answer.

  • Applet - Servlet - Database - Servlet- Applet

    Hi All,
    I am using Oracle8i and IE 5.0. I am trying to retrieve the data from a db table and display it.
    Sequence is as following:
    1. Query passed to the applet.
    2. Servlet excutes this query using JDBC and returns the resultset to applet.
    3. Applet displaysthe results.
    Is there anybody who has a code sample to do this, my id is [email protected] ? I am totally new to java and servlets. I would really appreciate any help.
    Thanks a lot.
    Manuriti
    [email protected]

    I've never dealt with the code to handle the applet portion of what you're trying to do, but I can help you with the servlet stuff.
    Your servlet should contain code to accomplish the following steps:
    1. Load an Oracle JDBC driver into memory.
    2. Open a JDBC connection to the Oracle database.
    3. Create a JDBC Statement object which contains the appropriate Oracle SQL code.
    4. Execute the Statement object, which will return a ResultSet.
    5. Read the ResultSet data.
    6. Pool or close the Statement and Connection objects.
    All of these steps are simple. Here's what they might look like in practice:
    // load the Oracle driver
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // open the connection
    String cs = "jdbc:oracle:[email protected]:1521:DBNAME"; // connection string
    String userName = "scott";
    String password = "tiger";
    Connection con = DriverManager.getConnection(cs, userName, password);
    // create a Statement object
    Statement stmt = con.createStatement();
    // create a ResultSet object
    ResultSet rs = stmt.executeQuery("select * from DUAL"); // your SQL here
    // INSERT CODE HERE TO READ DATA FROM THE RESULTSET
    // close the Statement object
    stmt.close();
    // close the Connection object
    con.close();
    So that's how you get data from your Oracle database. Now, how do you pass it to your applet? Well, this is hardly trivial. Typically, servlets return an HTML-formatted text stream. It is possible to have an applet communicate with a servlet, but that raises security issues that I don't fully understand. I believe you would have to have your user's browsers set to the lowest possible security settings, otherwise the browser won't let the applet open a socket to a foreign IP, but again, I'm shaky on that one.
    Anywho, let me know if this was of help and if you have more questions on the servlet/applet stuff. I can probably help you with more specific questions,.

  • Servlet database problem

    Hi iam sending text message from client and storing it in file in server....I want to store text value in database..
    I am doing following this to store text in database..............
    I am using Netbeans to connect to database....I have added classes12.jar of oracle to my servlet program............when ever i type select * from store; in database
    it says no rows selected plz let me know how i can insert text into data base............
    FileOutputStream fout = new FileOutputStream("image.jpg");     
                   StringBuffer message = new StringBuffer();
                   StringBuffer imageData = new StringBuffer();
                   while((line = r.readLine())!=null)
                        buf.append(line);
                   String s = buf.toString();
                   byte[] data = s.getBytes();
                   fout.write(data);
                   fout.close();
                   Class.forName("Oracle.jdbc.driver.OracleDriver");
                   Connection con = DriverManager.getConnection(
         "jdbc:oracle:this:@localhost:1521:orcl","scott", "tiger");
                   Statement st = con.createStatement();
                   response.setContentType("text/plain");
                   PrintWriter out = response.getWriter();
                   st.executeQuery("insert into store values('" + message + "','" + imageData + "'");
                   out.print("Inserted Successfully..");
                   out.print("Data Gathered recieved is "+ s);
    Thanks,

    {color:#000080}Not sure, but you may need to flush() the OutputStream.fout.write(data);
    fout.flush();
    fout.close();To post code, use code tags --{color} [code]CODE[/code] {color:#000080}is displayed as CODEdb{color}

  • Servlet induced communication

    Hi all,
    I am a java developer that recently turned its attention to j2me. I have recently wrote an application that sends and receives info from a servlet and uses it in a sort of interrup fashion: the server data constraints the mipd app state.
    What I would like to know is, if any of you has written anything like it before, which is the most "elegant" performance-wise way to communicate with a mipd application from a server point-of view.
    I mean, there are many ways to approach this and I would like to know more or to cut out the ludicrous one.
    Some ways I tried were:
    -midp app keeps sending requests to server asking if there is any change and server answers back accordingly (obviously, this is not right)
    -once they pass authentication phase midp and server do not close their input/output streams respectively so that they can keep communicating if need to (this option does not seem to be optimal)
    -server keeps URL of sending midp and uses it whenever it must update its state (this one haven't managed to succeed yet)
    So, I'm listening to comments/criticism if your willing to
    cheers
    j.

    Ok I know that. Now what I meant is do I need to poll the server for new messages (still using the chat-app between midlets example) or can I make both midlets open a connection to the server and send their messages to the server, and have the server redirect the messages to the respective client-midlet. I'm thinking something like each client midlet opens a connection, sends stuff whenever it wants (on the server side, output streams are not closed until some special flag is set) and keeps listening for answers until the user quits or say some special char comes from the server.
    The thing is I'm having some problems when I keep readStreams open after a while (inside a while loop waiting for some special code) and I was wondering if this is valid or is indeed a problem with my code.
    This is what I meant with tunnel before, not really say raw socket comm between midlets but a tunnel through a server that nevertheless kept each midlet from having to poll the ditto all the time. Apologies for not being too clear about it.
    I'm using something like (in pseudo pseudo-code & ommiting all the registration steps etc):
    client midlets
    conn = openConnection();
    out = conn.getOutpuStream();
    in = conn.getInputStream();
    if (!postbox.isEmpty()) {
    msg = removeHead(postbox);
    out.writeStream( sendMessage(msg) );
    ... on a separate thread
    while (USER_IS_ON){
    msg = in.readStream();
    if (msg != null) postbox.add(msg);
    close(conn, out, in);
    Server
    out = request.getOutpuStream();
    in = request.getInputStream();
    data = in.readStream();
    // write this guy's data on the other recipient's queue
    queue.add(data, id);
    ... on a separate thread
    while (USER_IS_ON){
    // get data to this guy from queue
    if (data = hasData(id) != null)
    out.writeStream(data, id);
    close(conn, out, in);
    On fear of making this too long, I'll stop here. I can post the source if you wish but it is rather lenghty :-)
    Thanks for the help!
    cheers
    j.

  • Servlet - j2me communication

    hi,
    i have written a basic servlet and j2me communication project. servlet gets the command, and increase counter value 1 up. from two different mobile phone emulators, i connect to the servlet. when i send a request to the servlet from one emulator, then counter returns 1. From the other emulator, when i send a request, then counter returns 2. do the two different emulators use the same session of the servlet? what is the servlet's logic? dont the two emulators create their own instance of the servlet?

    First of all, when you post code, please, use the "code" tags.
    I can't test your code but I start to analyse the method startApp() and there is:
    userName = new TextField("LoginID:", userName.getString(), 30, TextField.ANY);The object userName is null so
    userName.getString()throws a NullPointerException for sure!
    Hope this helps.

Maybe you are looking for

  • ITunes songs won't play on iPhone 5

    I've had my iPhone 5 for about a year now.  Never had this trouble before switching to this unit.  Never took the time to try and figure out the problem, as I knew it would be a long drawn out process over the phone, but this has been an issue since

  • Transaction F110 - Payment Run

    Dear Experts, I am using transaction F110 to print payment advise. I have copied the standard SAP script the associated  driving program  is RFFOEDI1. Further  I am using user exist in the SAPscript ie PERFORM  AND ENDPERFORM. I wanted to debug this

  • Generic Connection Framework implementation for J2SE

    Hi all, I need to use HttpConnection and Connector in my J2SE application because it was ported from CLDC/MIDP environment. I found that there is a JSR (197) but I not found an implementation of this document. The only usefull link I found with Googl

  • Set up withholding tax

    Hi I have created an sales invoice .whenever I transfer to A/r invoice ,after putting tax code ,it opens withholding tax for editing . It pops up with the window  .So far I have defined withholding tax ,tax categories ,tax  codes . When I try to chos

  • How to move photos before photostream to mac.

    My images on iPad2 are all synced between mac, iphone and ipad. Except for those put on my iPad with Apple Card reader before using photostream, iPhoto will only show those images that have been moved, not the ones I need to move. It doesn't matter i