URGENT! Java Bean Query

I am using Tomcat 3.1 and MySQL database for an application I am designing. Below is the code for a java bean that registers users details. The code compiles correctly, but I would like to know if there is any code that I might have left out? What changes should I make to make it more user friendly?
I do not want to use servlets, as they are very difficult to setup.
REGISTRATION.JAVA
package gcd;
import java.sql.*;
import java.util.*;
import java.lang.*;
import java.awt.*;
import java.text.*;
import java.io.*;
import com.mysql.jdbc.*;
public class Registration
     public Registration(){}
String first_name;
String last_name;
String role;
String email;
String error;
java.sql.Connection con;
public void setFirstName( String value )
first_name = value;
public void setLastName( String value )
last_name = value;
public void setRole( String value )
role = value;
public void setEmail( String value )
email = value;
public String getFirstName()
return first_name;
public String getLastName()
     return last_name;
public String getRole()
     return role;
public String getEmail()
     return email;
     public void connect() throws ClassNotFoundException, SQLException, Exception
try
System.setProperty("jdbc.drivers", "com.mysql.jdbc.Driver");
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/gcdBB_db","","");
catch (ClassNotFoundException e)
error = "ClassNotFoundException: Could not locate DB driver.";
throw new ClassNotFoundException(error);
catch (SQLException e)
error = "SQLException: Could not connect to database.";
throw new SQLException(error);
catch (Exception e)
error = "Exception: An unknown error occured while connecting to database.";
throw new Exception (error);
     public void disconnect() throws SQLException
try
if(con != null)
con.close();
catch (SQLException e)
error = ("SQLException: Unable to close the database connection.");
throw new SQLException(error);
public java.sql.ResultSet validateRegistration(String firstname, String lastname, String role, String email) throws SQLException, Exception
java.sql.ResultSet rs = null;
try
String queryString = ("INSERT INTO registration (firstname,lastname,role,email) VALUES ('" + firstname + "','" + lastname + "','" + role + "','" + email + "';");
java.sql.Statement stmt = con.createStatement();
rs = stmt.executeQuery(queryString);
catch (SQLException e)
error = "SQLException: Could not execute the query.";
throw new SQLException(error);
catch (Exception e)
error = "An exception occured while retrieving users.";
throw new Exception(error);
return rs;
Thanks,
Niall

in JavaBean class:
The setting/getting method should be matched with the first letter capitalized. ie.
String firstName;
String lastName;
public void setFirstName(String value) { firstName = value ; }
public String getFirstName() { return firstName; }
public void setLastName(String value) { lastName = value ; }
public String getLastName() { return lastName; }
String role and email coded correctly.
remember: put your bean in package and call from package.

Similar Messages

  • Urgent : java bean having bidirectional one to many relationship

    Hi,
    We have complex requirement in our application.
    We need to copy java bean having bidirectional one to many relationship to another javabean having bidirectional one to many relationship..
    E.g
    Class Basket1 {
    public String color;
    pubic String type;
    public List<Basket1> basketList = new ArrayList()
    Class Basket2 {
    public String color;
    pubic String type;
    public List<Basket2> basketList = new ArrayList()
    We need to exact copy Basket1 to Basket2. We are in trouble to copy List of child because we do not have how many child Basket1 have of same type..
    Can someone help us how we can implement such kind of complex object bidirectional one to many relationship??

    I can't see anything bidirectional about these relationships. What I can see is a couple of BasketN classes that look identical so I don't know why they both exist, and they both contain lists of themselves as members, which suggests some kind of tree structure. Nothing bidirectional there. I can see tat these things can form circular object graphs but I don't see why you would want to do that.
    We need to exact copy Basket1 to Basket2And I don't know what that means. Please explain.

  • Need urgent help on Java Bean

    Can some one help me to find a place for step by step documentation on how to create java bean and load an image thru java Bean on a form. I'm not loading from the same server it must be loaded from a different server.
    Very urgent please. I really appreciate any help.
    Thanks in advance.

    Hi,
    for the first part of your question: start Forms Builder, press F1 and the seach for Bean Area. The online help also comes with code examples
    for the second part, this URL will give you a head start: http://www.particle.kth.se/~lindsey/JavaCourse/Book/Java/Chapter11/loadingImages.html
    Frank

  • Java bean & SQL Query

    Hi;
    I'm facing problem in running my application on different relational databses b'cos i wrote all my queries for Oracle 8i on Win-NT environment.& now i've to deploy the application on the Linux with MS-SQL database.
    How to write sql query in java beans so that it run on all the relational databases without making changes to the query in every bean. OR
    How to get the compatible query for different databases?
    Thanks in advance.

    Hey Kalpesh
    If you have just the Connection process encapsulated in the Bean, then you can use it as a Singleton object.
    Just take a look at the following snippet
    public static getConnection(String db) {
    if (db.equalsIgnoreCase("ORACLE")) {
    if (con != null) {
    return con;
    } else {
    con = DriverManager.getConnection("jdbc:oracle:thin:@"+IP+", " + user + ", " + password);
    } else if (db.equalsIgnoreCase("SQLSERVER")) {
    if (con != null) {
    return con;
    } else {
    con = DriverManager.getConnection(sqlServerDBConnectionString);
    This way you can reduce the number of live connections.
    In the JSP, you can access this bean as:
    <jsp:useBean id="mb" class="MyBean" scope=whatever/>
    Connection con = mb.getConnection("ORACLE");
    or
    Connection con = mb.getConnection("SQLSERVER");
    This way, you can meet your objective.
    Check it out.

  • Query on Java Bean Usage in R12 Forms

    Hi,
    I have a scenario,
    There is a Java bean which has been working on Oracle 11i Forms for quite a while now.The bean is used to display two text fields which are populated on selecting a file using the Browse button on the right hand side.
    We have recently migrated this form to R12 and from then, the textfields dissappered.
    I have tried multiple ways, tried changing the background and foreground for the canvas, bean, fields.. I compiled the Bean using Java 1.5, so as to make it compatible to R12, but have not been able to make the fields visible.
    Anyone who could give me more insight in this regard would be of great help!!!
    Regards,
    Prathima.

    Following is the whole log :
    MSBeanArea is the name of my Java Bean.
    I have put some messages in my Java class in order to check if there is any where it is failing, but as you can see, there is no error raised :(
    ====================================================================================
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/cedarhr.gif
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.3
    Loaded image: jar:http://gmsuna.cedarhr.com:7854/forms/java/frmall.jar!/oracle/forms/icons/frame.gif
    Entered MSBeanArea
    In msbean class..
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/datalink.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/cnc_launch.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/dms.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tas.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hsr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/system.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/chg_pass.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/re_conn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/discover.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasremid.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_help.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Find.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/keys.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/save.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/list.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/addrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_print.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/delrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/exit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/up.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/down.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmeals.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasresce.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasnomlt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevent.gif
    Entered MSBeanArea
    In msbean class..
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_help.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Find.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/keys.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/save.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/list.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/addrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_print.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/delrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/exit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/up.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/down.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasqlrec.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasqlwiz.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasunkwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasdeldt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasaudit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tastnote.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevlog.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/taslettr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplcpy.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasaccom.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmeals.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasresce.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasnomlt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevent.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/cedarhr.gif
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.3
    Entered MSBeanArea
    In msbean class..
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/datalink.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/cnc_launch.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/dms.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tas.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hsr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/system.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/chg_pass.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/re_conn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/discover.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasremid.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_help.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Find.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/keys.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/save.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/list.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/addrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_print.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/delrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/exit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/up.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/down.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmeals.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasresce.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasnomlt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevent.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/cedarhr.gif
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.3
    Entered MSBeanArea
    In msbean class..
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/datalink.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/cnc_launch.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/dms.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tas.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/hsr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/system.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/chg_pass.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/re_conn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/discover.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasremid.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_help.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Find.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/keys.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/save.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/list.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/addrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_print.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/delrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/exit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/up.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/down.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmeals.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasresce.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasnomlt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevent.gif
    Entered MSBeanArea
    In msbean class..
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_help.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Find.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/keys.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/save.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/list.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/addrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_print.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/delrow.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/exit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbscrup.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/orbsdwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/up.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/Null.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/down.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasqlrec.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasqlwiz.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasmodr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasunkwn.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasdeldt.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplmts.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasaudit.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tastnote.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasevlog.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/taslettr.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasplcpy.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/tasaccom.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    Loaded image: http://gmsuna.cedarhr.com:7854/forms/java/k_query.gif
    ====================================================================================
    Regards,
    Prathima.

  • Java bean - urgent help

    Hi,
    I am creating a java bean in a jsp file. I want to pass this bean to a java class in the same jsp file.
    eg:
    A1.jsp
    <jsp:useBean id="customer" class="com.Customer" scope="session"/>
    <jsp:setProperty name="customer" property="*"/>
    <% Teller teller=new Teller();
    int custid=teller.addCustomer("customer");
    %>
    Teller.java
    public class Teller
    public int addCustomer(*C*ustomer pcus)
              CustomerDb Cdb=new CustomerDb();
              return Cdb.addCustomer(pcus);
    CustomerDb.java
    public class CustomerDb{
    int customerid;
    public int addCustomer(*C*ustomer pcus){
         try{
    some code....
    When I try to compile Teller.java and CustomerDb.java it is giving error in the lines highlighted with bold.
    Please help in this.

    Problem Description
    You are getting
    FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-105100.
    When you run FileUpload utility
    Solution Description
    Follow the steps given below to fix and run the FileUpload Bean successfully.
    Make sure you have set your System Path similar to following, in the same order:
    System PATH:
    E:\Dev6i\bin;E:\Dev6i\forms60\java;E:\jdk1.2.2\bin;E:\jdk1.2.2\jre\bin;
    E:\jdk1.2.2\jre\bin\classic; %SystemRoot%\system32;%SystemRoot%;
    %SystemRoot%\System32\Wbem;C:\Program Files\Oracle\JInitiator1.1.8.16\bin;.
    CLASSPATH :
    E:\dev6i\forms60\java;E:\dev6i\forms60\java\UploadServer.jar;
    E:\jdk1.2.2\jre\bin\classic;E:\jdk1.2.2\jre\lib;E:\Dev6i\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    Now, Open Form Builder ->Layout Editor->Program menu->Import Java Classes
    Check here to make sure that the FileUpload.class is displayed there under
    Oracle/forms/demos/uploadclient folder.
    Note that the java bean uses the implementation class
    file oracle.forms.demos.uploadclient.FileUploader
    So, you need to put the FileUploader.class in
    <ORACLE_HOME>\FORMS60\java\oracle\forms\demos\uploadclient\FileUploader.class
    or you need to change the oracle.forms.demos.uploadclient.FileUploader
    in implementation Class property matching to
    the class name where you have actually put it.
    You need to set archive_jini=f60all_jinit.jar,uploadclient.jar.sig in formsweb.cfg
    Open the fileupload.fmb, remove the attached Library.
    Open the fileupload.pll from File->Open.
    Recompile all the procedure and packages again.
    Save this fileupload.pll.
    Then reattach this library as a attached library to this form, recompile the form.
    This should solve the problem.
    If the path is set as explained above solves the PDEUI0001 problem of
    Java Importer also.
    Explanation
    Reason:
    This error occurs when the upload button is pressed in the File upload utility
    because the attached PLL library is not compiled properly.
    Please let me know if this helps.
    Regards
    Grant Ronald
    Forms Product Management

  • Urgent - Embedding visual java beans in JSP

    I have a custom TextBox .
    I want to embed that into my JSP, and want the JSP to be able to read the value / set the value of this text box as and when manipulated.
    How do I go about it?
    Should I usr <jsp:useBean> for viaula components or <jsp:plugin>
    Thank you.

    I do not want to use Applets.
    I want to embed my cuustom visual java bean in a JSP page.
    I am trying to figure some way out.

  • Need Help-How Store the input parameter through java bean

    Hello Sir,
    I have a simple Issue but It is not resolve by me i.e input parameter
    are not store in Ms-Access.
    I store the input parameter through Standard Action <jsp:useBean>.
    jsp:useBean call a property IssueData. this property exist in
    SimpleBean which create a connection from DB and insert the data.
    At run time servlet and server also show that loggging are saved in DB.
    But when I open the table in Access. Its empty.
    Ms-Access have two fields- User, Password both are text type.
    Please review these code:
    login.html:
    <html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>LoginServlet.java:
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String user=request.getParameter("user");
    String pass=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setUserName(user);
    st.setPassword(pass);
    request.setAttribute("user",st);
    request.setAttribute("pass",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String user="";
    private String pass="";
    private String s="";
    public String getUserName() {
    return user;
    public void setUserName(String user) {
    this.user = user;
    public String getPassword() {
    return pass;
    public void setPassword(String pass) {
    this.pass = pass;
    public String getIssueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getUserName();
    getPassword();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:simple");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUserName();
    st.setString(1,User);
    String Password=getPassword();
    st.setString(2,Password);
    st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }submit.jsp:
    This is Submit page
    <html><body>
    Hello
    Student Name: <%= ((co.SimpleBean)request.getAttribute("user")).getUserName() %>
    <br>
    Password: <%= ((co.SimpleBean)request.getAttribute("pass")).getPassword() %>
    <br>
    <jsp:useBean id="st" class="co.SimpleBean" scope="request" />
    <jsp:getProperty name="st" property="IssueData" />
    </body></html>web.xml:<web-app>
    <servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>one</servlet-name>
    <url-pattern>/tmp</url-pattern>
    </servlet-mapping>
    <jsp-file>issue.jsp</jsp-file>
    <jsp-file>submit.jsp</jsp-file>
    <url-pattern>*.do</url-pattern>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
    </web-app>Please Help me..Thanks.!!!
    --

    Dear Sir,
    Same issue is still persist. Input parameter are not store in database.
    After follow your suggestion when I run this program browser show that:i.e
    This is Submit page Hello Student Name: vijay
    Password: kumar
    <jsp:setProperty name="st" property="userName" value="userValue/> Your logging is saved in DB
    Please review my code.
    login.html:
    {code}<html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>{code}
    LoginServlet.java:
    {code}import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String userValue=request.getParameter("user");
    String passValue=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setuserName(userValue);
    st.setpassword(passValue);
    request.setAttribute("userValue",st);
    request.setAttribute("passValue",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }{code}
    SimpleBean.java:
    {code}package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String userValue="";
    private String passValue="";
    private String s="";
    public String getuserName() {
    return userValue;
    public void setuserName(String userValue) {
    this.userValue = userValue;
    public String getpassword() {
    return passValue;
    public void setpassword(String passValue) {
    this.passValue= passValue ;
    public String getissueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getuserName();
    getpassword();
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Connection loaded");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
    System.out.println("Connection created");
    PreparedStatement st=con.prepareStatement("insert into vij values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String userName=getuserName();
    st.setString(1,userName);
    String password=getpassword();
    st.setString(2,password);
    st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s= "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }{code}
    submit.jsp:
    {code}This is Submit page
    <html><body>
    Hello
    Student Name: <%= ((co.SimpleBean)request.getAttribute("userValue")).getuserName() %>
    <br>
    Password: <%= ((co.SimpleBean)request.getAttribute("passValue")).getpassword() %>
    <br>
    <jsp:useBean id="st" class="co.SimpleBean" scope="request" />
    <jsp:setProperty name="st" property="userName" value="userValue/>
    <jsp:setProperty name="st" property="password" value="passValue"/>
    <jsp:getProperty name="st" property="issueData" />
    </body></html>web.xml:<web-app>
    <servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>one</servlet-name>
    <url-pattern>/tmp</url-pattern>
    </servlet-mapping>
    <jsp-file>submit.jsp</jsp-file>
    <url-pattern>*.do</url-pattern>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
    </web-app>Sir I can't use EL code in jsp because I use weblogic 8.1 Application Server.This version are not supported to EL.
    Please help me...How store th input parameter in Database through Java Bean                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • An error in jsp page useBean when i try to include the java bean package?

    Hi Sir,
    I am using import com.project.ShowData in java beans inorder to connect to the jsp.
    The jsp code goes like this:-
    <%@ page import="com.project.ShowData" %>
    <jsp:useBean id="jspuser1" class="com.viman.ShowData" scope="session"/>
    <jsp:setProperty name="jspuser1" property="*"/>
    Here the error is showing as cannot resolve symbols in com.project.ShowData.But i have given the same in java beans like this:-
    Package com.project;
    //import of package goes here
    public class ShowData
    //code goes here
    It seems that all are correct here.I have done few programs using this without any problem.But suddenly it is giving a problem like this.What is the problem here?It is quite Urgent.Thank u.
    Regards,
    m.ananthu

    Greetings,
    Here the error is showing as cannot resolve symbols in com.project.ShowData.But i have given the
    same in java beans like this:-Seeing the actual error would be more helpful. ;)
    Regards,
    m.ananthu Regards,
    Tony "Vee Schade" Cook

  • How to get an XML string from a Java Bean without wrting to a file first ?

    I know we can save a Java Bean to an XML file with XMLEncoder and then read it back with XMLDecoder.
    But how can I get an XML string of a Java Bean without writing to a file first ?
    For instance :
    My_Class A_Class = new My_Class("a",1,2,"Z", ...);
    String XML_String_Of_The_Class = an XML representation of A_Class ?
    Of course I can save it to a file with XMLEncoder, and read it in using XMLDecoder, then delete the file, I wonder if it is possible to skip all that and get the XML string directly ?
    Frank

    I think so too, but I am trying to send the object to a servlet as shown below, since I don't know how to send an object to a servlet, I can only turn it into a string and reconstruct it back to an object on the server side after receiving it :
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class Servlet_Message        // Send a message to an HTTP servlet. The protocol is a GET or POST request with a URLEncoded string holding the arguments sent as name=value pairs.
      public static int GET=0;
      public static int POST=1;
      private URL servlet;
      // the URL of the servlet to send messages to
      public Servlet_Message(URL servlet) { this.servlet=servlet; }
      public String sendMessage(Properties args) throws IOException { return sendMessage(args,POST); }
      // Send the request. Return the input stream with the response if the request succeeds.
      // @param args the arguments to send to the servlet
      // @param method GET or POST
      // @exception IOException if error sending request
      // @return the response from the servlet to this message
      public String sendMessage(Properties args,int method) throws IOException
        String Input_Line;
        StringBuffer Result_Buf=new StringBuffer();
        // Set this up any way you want -- POST can be used for all calls, but request headers
        // cannot be set in JDK 1.0.2 so the query string still must be used to pass arguments.
        if (method==GET)
          URL url=new URL(servlet.toExternalForm()+"?"+toEncodedString(args));
          BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
        else     
          URLConnection conn=servlet.openConnection();
          conn.setDoInput(true);
          conn.setDoOutput(true);           
          conn.setUseCaches(false);
          // Work around a Netscape bug
          conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
          // POST the request data (html form encoded)
          DataOutputStream out=new DataOutputStream(conn.getOutputStream());
          if (args!=null && args.size()>0)
            out.writeBytes(toEncodedString(args));
    //        System.out.println("ServletMessage args: "+args);
    //        System.out.println("ServletMessage toEncString args: "+toEncodedString(args));     
          BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
          out.flush();
          out.close(); // ESSENTIAL for this to work!          
        return Result_Buf.toString();               // Read the POST response data   
      // Encode the arguments in the property set as a URL-encoded string. Multiple name=value pairs are separated by ampersands.
      // @return the URLEncoded string with name=value pairs
      public String toEncodedString(Properties args)
        StringBuffer sb=new StringBuffer();
        if (args!=null)
          String sep="";
          Enumeration names=args.propertyNames();
          while (names.hasMoreElements())
            String name=(String)names.nextElement();
            try { sb.append(sep+URLEncoder.encode(name,"UTF-8")+"="+URLEncoder.encode(args.getProperty(name),"UTF-8")); }
    //        try { sb.append(sep+URLEncoder.encode(name,"UTF-16")+"="+URLEncoder.encode(args.getProperty(name),"UTF-16")); }
            catch (UnsupportedEncodingException e) { System.out.println(e); }
            sep="&";
        return sb.toString();
    }As shown above the servlet need to encode a string.
    Now my question becomes :
    <1> Is it possible to send an object to a servlet, if so how ? And at the receiving end how to get it back to an object ?
    <2> If it can't be done, how can I be sure to encode the string in the right format to send it over to the servlet ?
    Frank

  • Java server page compiler can not find a class defined in a java bean file

    I have a jsp file using java bean. The java bean class file is uploaded into the server and also the directory to this java bean .class file is included in the Unix environment CLASSPATH. This .jsp file is registered and should be compiled and excecuted automatically.
    WHen I try to invoke this .jsp file, the jsp compiler error, saying the class defined by java bean can not be found. I already include this path in teh CLASSPATH, I thought the jsp compiler will go to the right place according to CLASSPATH to find the referenced class.
    Can anyone tell me what I have done wrong or what should I do in order to allow jsp compiler to find the class refrenced by .jsp file and defined by java bean file?
    Thank you so much

    hello friends,
    i am also facing the same problem of not finding bean class files for both jsp and servlet though it is placed in same package. the problem of not finding bean class file for jsp is experienced in Tomcat server only whereas in Blazix, there is no such error and the file is compiled and runs successfully.
    i have checked Tomcat properly. there is no error in its configuration also servlets without the use of bean files run successfully. so please can anybody guide me about what is the problem and how to solve it. plz its urgent .

  • Request parameter are not stored in database through Java Bean

    Hi,
    I want to store the request parameter in database through Java Bean.Allthough program are properly run but value are not store in DB.
    Here My code:
    Login.html:<html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="submit.jsp" >
    Name: <input type="text" name="User">
    Password: <input type="password" name="Pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean implements java.io.Serializable{
    private String User="";
    private String Pass="";
    public SimpleBean(){}
    public String getUser() {
    return User;
    public void setUser(String User) {
    this.User = User;
    public String getPass() {
    return Pass;
    public void setPass(String Pass) {
    this.Pass = Pass;
    public void show()
         try
    System.out.println("Printed*************************************************************");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:Ex11dump");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUser();
    st.setString(1,User);
    String Pass=getPass();
    st.setString(2,Pass);
    int y= st.executeUpdate();
    System.out.println(y);
    System.out.println("Query Executed");
    con.commit();
    con.close();
    System.out.println("Your logging is saved in DB *****************");
    catch(Exception e)
    e.printStackTrace();
    }submit.jsp:
    <jsp:useBean id="obj" class="co.SimpleBean"/>
    <jsp:setProperty name="obj" property="*" />
    <jsp:getProperty name="obj" property="User" /> <br>
    <jsp:getProperty name="obj" property="Pass" /> <br>
    <% obj.show();%>
    <%
    out.println("Ur data is saved in DB");
    %>Please Help me.
    Thanks.

    The issue is in the naming of your fields.
    Change User -> user and Pass->pass
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">

  • Help with Login Form (JSP DB Java Beans Session Tracking)

    Hi, I need some help with my login form.
    The design of my authetication system is as follows.
    1. Login.jsp sends login details to validation.jsp.
    2. Validation.jsp queries a DB against the parameters received.
    3. If the query result is good, I retrieve some information (login id, name, etc.) from the DB and store it into a Java Bean.
    4. The bean itself is referenced with the current session.
    5. Once all that's done, validation.jsp forwards to main.jsp.
    6. As a means to maintain state, I prefer to use url encoding instead of cookies for obvious reasons.I need some help from step 3 onwards please! Some code snippets will do as well!
    If you think this approach is not a good practice, pls let me know and advice on better practices!
    Thanks a lot!

    Alright,here is an example for you.
    Assume a case where you don't want to give access to any JSP View/HTML Page/Servlet/Backing Bean unless user logging system and let assume you are creating a View Object with the name.
    checkout an example (Assuming the filter is being applied to a pattern * which means when a resource is been accessed by webapplication using APP_URL the filter would be called)
    public doFilter(ServletRequest req,ServletResponse res,FilterChain chain){
         if(req instanceof HttpServletRequest){
                HttpServletRequest request = (HttpServletRequest) req;
                HttpSession session = request.getSession();
                String username = request.getParameter("username");
                String password = request.getParameter("password");
                String method = request.getMethod();
                String auth_type  = request.getAuthType();
                if(session.getAttribute("useInfoBean") != null)
                    request.getRequestDispatcher("/dashBoard").forward(req,res);
                else{
                        if(username != null && password != null && method.equaIsgnoreCase("POST") && (auth_type.equalsIgnoreCase("FORM_AUTH") ||  auth_type.equalsIgnoreCase("CLIENT_CERT_AUTH")) )
                             chain.doFilter(req,res);
                        else 
                          request.getRequestDispatcher("/Login.jsp").forward(req,res);
    }If carefully look at the code the autherization is given only if either user is already logged in or making an attempt to login in secured way.
    to know more insights about where these can used and how these can be used and how ?? the below links might help you.
    http://javaboutique.internet.com/tutorials/Servlet_Filters/
    http://e-docs.bea.com/wls/docs92/dvspisec/servlet.html
    http://livedocs.adobe.com/jrun/4/Programmers_Guide/filters3.htm
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
    http://www.servlets.com/soapbox/filters.html
    http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
    and coming back to DAO Pattern hope the below link might help you.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
    http://java.sun.com/blueprints/patterns/DAO.html
    http://www.javapractices.com/Topic66.cjp
    http://www.ibm.com/developerworks/java/library/j-dao/
    http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html
    On the whole(:D) it is always a good practice to get back to Core Java/J2EE Patterns.and know answers to the question Why are they used & How do i implement them and where do i use it ??
    http://www.fluffycat.com/java-design-patterns/
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
    http://www.cmcrossroads.com/bradapp/javapats.html
    Hope that might help :)
    REGARDS,
    RaHuL

  • User parameter are not show in database using Servlet and java Bean

    Hello Sir,
    when I insert the parameter in run time, weblogic server and JSP show that parameter are saved.
    Allthough row increment in database but they not show in database.
    Here My Code:
    login.html:
    <html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>LoginServlet.java:import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String user=request.getParameter("user");
    String pass=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setuserName(user);
    st.setpassword(pass);
    request.setAttribute("user",st);
    request.setAttribute("pass",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String user="";
    private String pass="";
    private String s="";
    public String getuserName() {
    return user;
    public void setuserName(String user) {
    this.user = user;
    public String getpassword() {
    return pass;
    public void setpassword(String Pass) {
    this.pass= pass ;
    public String issueData()
    try
    System.out.println("Printed*************************************************************");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Connection loaded");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
    System.out.println("Connection created");
    PreparedStatement st=con.prepareStatement("insert into vij2 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String NAME=getuserName();
    st.setString(1,NAME);
    String PASSWORD=getpassword();
    st.setString(2,PASSWORD);
      st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }submit.jsp:This is Submit page
    <jsp:useBean id="st" class="co.SimpleBean"/>
    <jsp:setProperty name="st" property="*" />
    <jsp:getProperty name="st" property="userName" /> <br>
    <jsp:getProperty name="st" property="password" /> <br>
    <% st.issueData();%>
    <%
    out.println("Ur data is saved in DB");
    %>Please Help me.
    Thanks.

    Ok, this seems to be a long and convoluted path to do absolutely nothing.
    You submit the form.
    You run a servlet that gets the parameters correctly (good), creates a SimpleBean (good) and then sets this into request attribute space under the names "user" and "pass" - (why?)
    You then forward to the jsp: submit.jsp.
    Submit.jsp creates a new SimpleBean, and attempts to populate it with <jsp:setProperty>. You then call the issueData method on it.
    Your complaint: Rows are being created in the database which have empty string values instead of the parameters you have passed.
    So, why are the values blank? Where do you think these values should be coming from?
    Looking at SimpleBean we find one mistake - you have mis-named your get/set methods.
    To properly follow java beans standards, you should use camel-case for your methods.
    Rather than getuserName() the method should be getUserName(). getpassword() should be getPassword() etc etc.
    The method getUserName() defines a property "userName" for the bean.
    Once that is fixed, lets go to submit.jsp. The <jsp:setProperty> statement will try and set all properties of the bean from the request parameters.
    There are no request parameters "userName" or "password" so those values don't get set in the bean, therefore it uses their default value of empty string - "".
    There ARE request parameters called "user" and "pass" but because they aren't properties of the bean, they get ignored.
    As a result, the values are empty string, and that is exactly what gets inserted into the database.
    Ways to fix this
    1 - rename your parameters on your form to be "userName" and "password" to match the bean. That way the <jsp:setProperty> tag will populate them properly.
    or
    2 - Call issueData() method from your servlet after you have created the SimpleBean. Better in my opinion as you then don't have any scriptlet code on a JSP page.
    Cheers,
    evnafets

  • Forms 6i and Java Bean

    Hi
    I need to establish communication between my forms and java code.
    i have made a java bean and set the implementation class path(i.e the package path (oracle.forms.demo for the bean class)) in the form item.
    I want to know where exactly should put the java code or do i have to make modification in any of the environment variables to allow the forms to acces the java code.
    what exactly is a java class and do i need to have a wrapper class also to implement the java bean.
    please respond fast as i need this info urgently...any small info might prove fruitful
    Thanks
    Message was edited by:
    user532526

    Hello,
    All you have to do is to copy the .jar file that contains the Java class(es) in the <devsuite>/forms/java/ directory, configur the <devsuite>/forms/server/formsweb.cfg file to add this jar file to the archive_jini tag to indicate where Forms have to load the classes:
    archive_jini=frmall_jinit.jar,...,my_jar_file.jar
    Then after, you have 2 possibilities:
    - the bean does not have any "screen" representation so you can just handle its functions with the Forms internal FBean package functions (no need to put implementation class on the bean area item property)
    - it has a screen representation, so you put its implementation class like you did, and you set its properties with the Set_Custom_Property() built-in and get its properties with the Get_Custom_Property() built-in.
    Francois

Maybe you are looking for