PLSQL for a search form -- based off of the issue tracker tutorial

Here is the basic query that returns the results that I need: (works in toad)
SELECT i.id,
i.date_modified,
i.last_name,
i.first_name,
i.email_address,
i.job_title,
c.br_disc as branch,
d.loc_num as branch_num,
i.change_agent,
i.super_name as supervisor
FROM SAP_USER_INFO i,
SAP_BRANCH_LOCATION c,
SAP_BRANCH_LOC_NUM d
WHERE
i.branch_name = c.ID
and
d.loc_num = 1444
Now here is my plsql:
DECLARE
q VARCHAR2(32767); -- query
w VARCHAR2(4000) ; -- where clause
we VARCHAR2(1) := 'N'; -- identifies if where clause exists
BEGIN
q := 'select "i"."ID", '||
' "i"."LAST_NAME", '||
' "i"."FIRST_NAME", '||
' "i"."ORGANIZATION", '||
' "i"."JOB_TITLE", '||
' "i"."SUPER_NAME" as supervisor, '||
' "i"."SUPER_EMAIL", '||
' "i"."BRANCH_NAME" as BRANCH_NAME, '||
' "c"."BR_DISC" as "BRANCH", '||
' "d"."LOC_NUM" as "BRANCH_NUMBER" '||
' FROM "#OWNER#"."SAP_USER_INFO" "i", '||
' "#OWNER#"."SAP_BRANCH_LOCATION" "c", '||
' "#OWNER#"."SAP_BRANCH_LOC_NUM" "d" ';
IF :P19_AGENT_NAME != '-1'
THEN
w := ' CHANGE_AGENT = :P19_AGENT_NAME ' ;
we := 'Y';
END IF;
IF :P19_BRANCH_NUMBER != '-1'
THEN
IF we = 'Y'
THEN
w := w || ' AND BRANCH_NUMBER = :P19_BRANCH_NUMBER AND BRANCH_NAME = "c"."id" ';
ELSE
w := ' BRANCH_NAME = c.id AND BRANCH_NUMBER = :P19_BRANCH_NUMBER';
we := 'Y';
END IF;
END IF;
IF we = 'Y'
THEN q := q || ' WHERE '|| w;
END IF;
RETURN q;
END;
Please forgive me as I'm very new to plsql. I keep getting errors on the where clause. Does anyone see a formatting problem jump out at them?
failed to parse SQL query:
ORA-00904: "c"."id": invalid identifier

Larry,
Thanks for the reply. That seemed to work but I have found that my query is not doing what i thought that it would. So i've included a sub select. Do you know off the top of your head how I should handle a "(". If you look at this line:
' FROM ( SELECT "i"."id", '||
I don't know if I need to handle that ( in a diffrent way.
This is what I'm at now:
DECLARE
q VARCHAR2(32767); -- query
w VARCHAR2(4000) ; -- where clause
we VARCHAR2(1) := 'N'; -- identifies if where clause exists
BEGIN
q := 'SELECT "id", '||
' "date_modified", '||
' "last_name", '||
' "first_name", '||
' "email_address", '||
' "job_title", '||
' "branch", '||
' "branch_num", '||
' "supervisor" '||
' FROM ( SELECT "i"."id", '||
' "i"."date_modified", '||
' "i"."last_name", '||
' "i"."first_name", '||
' "i"."email_address", '||
' "i"."job_title", '||
' "c"."BR_DISC" as "branch", '||
' "d"."LOC_NUM" as "branch_num", '||
' "i"."super_name" as "supervisor" '||
' FROM "SAP_USER_INFO" "i", '||
' "SAP_BRANCH_LOCATION" "c", '||
' "SAP_BRANCH_LOC_NUM" "d" '||
' WHERE "i"."BRANCH_NAME" = "c"."ID" '||
' AND "i"."BRANCH_NUMBER" = "d"."ID" ) ';
IF :P20_AGENT_NAME != '-1'
THEN
w := ' CHANGE_AGENT = :P20_AGENT_NAME ' ;
we := 'Y';
END IF;
IF :P20_BRANCH_NUMBER != '-1'
THEN
IF we = 'Y'
THEN
w := w || ' AND "d"."LOC_NUM" = :P20_BRANCH_NUMBER ';
ELSE
w := ' "d"."LOC_NUM" = :P20_BRANCH_NUMBER AND "i"."BRANCH_NAME" = "c"."ID"';
we := 'Y';
END IF;
END IF;
IF we = 'Y'
THEN q := q || ' WHERE '|| w;
END IF;
RETURN q;
END;
The Error that returns is:
1 error has occurred
Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00904: "i"."super_name": invalid identifier
Message was edited by:
Mike.R

Similar Messages

  • After creating a searchable database I am unable to search documents based off of the bates number.

    I just finished creating a searchable database in Adobe Acrobat Pro and it finds documents based off of search terms fine. It does not however locate documents based off of the Bates number that I am using as a search term. Why won't it let me do this?

    Hi Dodu.NET,
    Please refer the Kb Doc : http://helpx.adobe.com/creative-suite/kb/error-exit-6-exit-7.html.
    Please see Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html for information on how to review your installation logs
    In addition you cna try these steps :
    > Enable the hidden Admin Account on Windows 7 ( Ref :  http://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-wi ndows-vista/ )
    > Disable all Non-Microsoft Startup Services. (Ref : http://helpx.adobe.com/x-productkb/global/disable-startup-items-services-windows.html )
    > Disable all the Antivirus softwares like CA, Norton,Mc Afee etc. temporarily from the computer.
    Reboot and try installing in the new enabled Admin user account and check.

  • Form-based authentication stores the username/password pair in the session

    Hello,
    I am following the SR Demo and the authentication method followed is
    Form-based authentication stores the username/password pair in the session
    In the URl, the username and password is in clear text format.
    What is the best way of doing the authentication. How can I eliminate the username and password being shown in the URL?
    Any help is highly appreciable.
    Thanks

    Hi,
    this is how form based authentication works according the specs. You can use SSL to protect the communication, use BASIC authentication (though not much better), certificate based auhentication or SSO
    Frank

  • Can I auto submit a WebApp Search form (with javascript) so the results show up automatically?

    Can I automatically submit a WebApp Search form (with javascript) so the results show up automatically?

    yes. I also interested in how to do it.

  • I hit the power button and it runs for a second then turns off but the power buttton stays lit

    i hit the power button and it runs for a second then turns off but the power buttton stays lit

    What machine?
    Mac Pro? Mac Pro what?
    If Mac Pro, wrong forum. Go here:
    Mac Pro

  • Creating a search form based on a table.

    Hello,
    I'm currently trying to create a search form which performs a searchquery in values stored in a table in my database.
    The table is filled peoples names,lastnames ,telephonenumbers and departments.
    I can use the sample application to make a form based on the tableview but this returns a search textfield for every column in the table. I just want 1 searchfield/textfield to search on ALL columns at the same time and display the other fields as labels when returning the queryresults.
    I tried searching the forums for an explanation on how to build said form and I checked Metalink but I have yet to find one. Anyone out there willing to help me out?
    thanks in advance,
    Melvin K.

    Why not use an instr with your data in a bind variable in your where clause for the select?? Page 1 sets an item called P2_Parameter with your value string slightly modified ('12345','345632','645534534','3434344')
    Select a,b,c,d,e from some_table where INSTR(TO_CHAR(Lookup_column,'099999999'),:P2_Parameter)
    Maybe that will work? Its off the top of my head, but should get you what you want.. (But to agree with one of the other posters, it is a BAD Design..) I would try like an interactive report to allow them to enter in acct #'s or whatever these are and let them access the rows that way..
    Thank you,
    Tony Miller
    Webster, TX

  • ADF Swing Search form based on readonly VO

    Hello,
    Does somebody know how to use the JUNavigationBar search form, when it is binded to ViewObject, that is readonly?
    The problem is that the form begins readonly too...
    Thanks,
    Jordan

    Hi,
    you could create your own parameter form and pass the data to a method on the ApplicationModule that hen applied the ViewCriteria. Alternatively you add bind variables to the query and use a form based on the ExecuteWithParams operation
    Frank

  • Ask for help with form based authentication & authorization

    Hi:
    I encountered the following problem when I tried the form based authentication & authorization (see the attached part of the config files, web.xml, weblogic.xml & weblogic.properties)
    1. authorization seems not invoked against the rules specfied, it doesn't go the login error page as long as the user/pwd match, even though the user does not have the necessary role
    in the example below, user3 should be denied to access the signin page, but seems no login error page returned, actually I never see any page / error message which complain about the authorization / access control error
    2. after authenticate correctly, always get redirected to the / (context root) url, instead of the url prior the login page, for e.g., signin page
    Any idea ?
    Thanks in advance.
    HaiMing
    attach config files
    web.xml
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>MySecureBit1</web-resource-name>
    <description>no description</description>
    <url-pattern>/control/signin</url-pattern>
    <http-method>POST</http-method>
    <http-method>GET</http-method>
    </web-resource-collection>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>default</realm-name>
    <form-login-config>
    <form-login-page>/control/formbasedlogin</form-login-page>
    <form-error-page>/control/formbasedloginerror</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <description>the customer role</description>
    <role-name>customer</role-name>
    </security-role>
    weblogic.xml
    <security-role-assignment>
    <role-name>
    customer
    </role-name>
    <principal-name>
    customer_group
    </security-role-assignment>
    weblogic.properties
    weblogic.password.user1=user1pass
    weblogic.password.user2=user2pass
    weblogic.password.user3=user3pass
    weblogic.security.group.customer_group=user1,user2

    Hi, Paul:
    Thanks a lot for your reply.
    Firstly let me just correct a little in the attachment I put previously, I think I missed following lines :
    <auth-constraint>
    <description>no description</description>
    <role-name>customer</role-name>
    </auth-constraint>
    So, user1 & user2 are in the customer group, but user3 not, and /control/singin is protected by this security constraint, as a result, when anyone click the link to /control/singin, he was led to the login page, if he tries to login as user1 & user2, he should pass & led to original page (in this case /control/singin, and my code's logic, once /control/signin is used, means that he already login successfully & redirected to the login success page), but if he tries to login as user3, he should only pass the authentication check, but fail the authorization check, and led to login error page.
    What not happen are :
    1. user1 & user2 pass, but redirect to /
    2. user3 also pass, because I see that debug message shows also get redirected to /, instead of login error page
    (login error page will be displayed, only if I try to login as a user with either wrong userid, or wrong password)
    3. one more thing I notice after I first time post the message, the container does not remember the principal, after 1. is done, not even for a while
    And the similar configuration works under Tomcat 3.2.1, for all 3. mentioned above.
    Any idea ?
    HaiMing
    "Paul Patrick" <[email protected]> wrote:
    If I understand what your trying to do, everyone should get access to the
    login page since roles are not
    associated with principals until after they authenticate. If I follow what
    you specified in the XML files,
    authenticated users user1 and user2 are members of a group called
    customer_group.
    The principal customer_group (and therefore its members) is mapped in the
    weblogic.xml file to the role
    customer.
    I can't speak to the reason your being redirected to the document root.
    Paul Patrick
    "HaiMing" <[email protected]> wrote in message
    news:[email protected]...
    Hi:
    I encountered the following problem when I tried the form basedauthentication & authorization (see the attached part of the config files,
    web.xml, weblogic.xml & weblogic.properties)
    1. authorization seems not invoked against the rules specfied, itdoesn't go the login error page as long as the user/pwd match, even though
    the user does not have the necessary role
    in the example below, user3 should be denied to access the signinpage, but seems no login error page returned, actually I never see any page
    / error message which complain about the authorization / access control
    error
    2. after authenticate correctly, always get redirected to the / (contextroot) url, instead of the url prior the login page, for e.g., signin page
    Any idea ?
    Thanks in advance.
    HaiMing
    attach config files
    web.xml
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>MySecureBit1</web-resource-name>
    <description>no description</description>
    <url-pattern>/control/signin</url-pattern>
    <http-method>POST</http-method>
    <http-method>GET</http-method>
    </web-resource-collection>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>default</realm-name>
    <form-login-config>
    <form-login-page>/control/formbasedlogin</form-login-page>
    <form-error-page>/control/formbasedloginerror</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <description>the customer role</description>
    <role-name>customer</role-name>
    </security-role>
    weblogic.xml
    <security-role-assignment>
    <role-name>
    customer
    </role-name>
    <principal-name>
    customer_group
    </security-role-assignment>
    weblogic.properties
    weblogic.password.user1=user1pass
    weblogic.password.user2=user2pass
    weblogic.password.user3=user3pass
    weblogic.security.group.customer_group=user1,user2

  • Help for-offline interactive forms based on sending receiving mails in ABAP

    hello friends i am struck with a requirement of my client.
    I am new to Forms and WEBDYNPRO and I have to cover a scenario where I have to develop,'offline interactive forms based on sending receiving emails '..
    i browsed a bit and with all the luck found a very good resource.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cacb9a7d-0c01-0010-1281-be4962c9ab3e
    but the problem is it is in JAVA.. I dont know JAVA..I know ABAP..
    can any one give me similar tutorial in ABAP or any other related links ..
    waiting to give Big Reward Points...

    Try these links...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/90e279fe-0107-2a10-bc85-bd96ab9738a7
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5087262b-59ef-2910-abb1-957000b7c3d4
    Hope they help.....
    Rao

  • Search form with af:pannelTabbed results issue

    Hi all,
    I've created a search page with an ADF Parameter Form based on an ExecuteWithParams operation.
    Following [url http://blogs.oracle.com/shay/2010/12/combining_multiple_queries_and.html?goback=.gde_1002457_news_308820955]Shay Shmeltzer´s post, the search form queries two view objects simultaneously and the results are displayed in two tables (each in a different tab).
    Everything goes fine if both tables are displayed in the same af:showDetailItem tab.
    If each table is displayed in a different tab then executing the search works for the first tab (the one that's disclosed by default). But when clicking on the second tab, no results are displayed. I have to reexecute the search.
    Any help will be appreciated.
    Barbara
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60

    Most probably your problem is different, but I remembered another (possibly similar) problem.
    A few months ago another guy had a problem related to PPR of content on a ShowDetailItem in a PanelTabbed. He had not set the whole ShowDetailItem as PPR target but he had set a PanelFormLayout inside the ShowDetailItem as a PPR target. The problem was workarounded by setting either the whole ShowDetailItem or the whole PanelTabbed as a PPR target. So if you have not set the whole ShowDetailItem as a PPR target of the "execute query" button (by using ShowDetailItem's "partialTriggers" attribute), please try what will happen if you set it.
    Dimitar

  • Modifying the search form so it appends the '%' to String input fields

    Hi guys,
    How can I modify the search form to search for '%'sometext'%' instead of just sometext for input fields that take string type as input; not programmatically!

    Hi,
    you would have to do this one way or the other. Either in the managed bean (which then passes the search input to the underlying model) or in the business services (ADF BC for example)
    Frank

  • My photos library has been loading for four days.  Any idea what the issue might be?

    My iCloud photos library has been trying to load for four days.  What is the issue?

    Greetings ok_takem,
    After reading your post, it sounds like you are experiencing an issue with photo syncing. You may want to consider restarting the device first, and then resetting if that does not work. This article provides detailed instructions for Restarting, and Reseting:
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    How to restart
    Press and hold the Sleep/Wake button until the red slider appears.
    Drag the slider to turn your device completely off.
    After the device turns off, press and hold the Sleep/Wake button again until you see the Apple logo.
    How to reset
    You should reset your device as a last resort and only if you can't restart it.
    To reset, press and hold both the Sleep/Wake and Home buttons for at least 10 seconds, until you see the Apple logo.
    Thank you for contributing to Apple Support Communities.
    Best,
    Bobby_D

  • HT203167 one of my tracks i.e. Sultans of swing ( Dire Straits) should last for 10.54 minutes but now only plays for ten second then carries on to the next track, how can I restore the original download ?

    One of my tracks i.e. Sultans of Swing (Dire Straits) should last for 10.54 minutes but cuts off after 11 seconds, then plays the next track.
    How can I re-download the track again to restore it?

    Delete problem track from library (if it is an iTunes Store purchase and you entitled to redownload past purchases - stop otherwise!)
    Close iTunes
    Open iTunes
    Select iTunes Store in left-hand column
    Select Purchased in right-hand column
    Select Music and Not on this computer
    The track should be listed now with a small cloud symbol which lets you download it.
    If you start downloading the track in step 7 then... While downloading select Downloads in the left-hand column and make sure Allow Simultaneous Downloads is unticked. (Should should help improve the reliablility of future downloads made with this build of iTunes.)
    If the above hasn't helped then... contact the iTunes Store support staff through the "Report a problem" links in your account history, or via Contact Support.
    tt2

  • Known fixes for crash upon opening do not fix the issue

    Browser will not load, fixes from support page that apply do not rectify the issue. Am not well-versed enough to know if what I'm seeing in the report (crash ID below) is telling me what's going on. Can't even open Profile Manager without the same crash message appearing instead.

    Thank you so much, for once in my computer life I knew what the problem was, what caused it, why it was caused, what it did, what it made it do and most importantly how to fix it and to do it correctly and expeditiously. I can not Thank You all enough for all of the help! I also have Pogo mailed this to all on my friends list, where they have all learned as I have and have fixed theirs also. and the message is being spread. Thank You again, I just can not say it enough.

  • Retrieving results for comparison in form based authentication with entitie

    Hi,Im developing an application using EJB3.0 and at the moment im working on a module involving user authentication.I work with the sun java system appserver 9.1 and netbeans 5.5.2 using the default toplink as the persistent provider.I have problems performing user based authentication.where am at is at shown below.I used a SLSB facade design pattern and created an entity from an existing database I built solely for the application (table name user_table). This is the code I have currently:
    Entity
    * UserTable.java
    * Created on 31 March 2008, 16:06
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package Entities;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.Table;
    * Entity class UserTable
    * @author Ayo
    @Entity
    @Table(name = "user_table")
    public class UserTable implements Serializable {
    @Id
    @Column(name = "user_id", nullable = false)
    private Integer userId;
    @Column(name = "username")
    private String username;
    @Column(name = "password")
    private String password;
    @Column(name = "user_type")
    private String userType;
    @Column(name = "access_level")
    private String accessLevel;
    @Column(name = "staff_id")
    private Integer staffId;
    @Column(name = "staff_type", nullable = false)
    private String staffType;
    @Column(name = "time_created")
    private String timeCreated;
    @Column(name = "time_modified")
    private String timeModified;
    @Column(name = "time_logged_in")
    private String timeLoggedIn;
    @Column(name = "time_logged_out")
    private String timeLoggedOut;
    @Column(name = "created_by")
    private String createdBy;
    /** Creates a new instance of UserTable */
    public UserTable() {
    * Creates a new instance of UserTable with the specified values.
    * @param userId the userId of the UserTable
    public UserTable(Integer userId) {
    this.userId = userId;
    * Creates a new instance of UserTable with the specified values.
    * @param userId the userId of the UserTable
    * @param staffType the staffType of the UserTable
    public UserTable(Integer userId, String staffType) {
    this.userId = userId;
    this.staffType = staffType;
    * Gets the userId of this UserTable.
    * @return the userId
    public Integer getUserId() {
    return this.userId;
    * Sets the userId of this UserTable to the specified value.
    * @param userId the new userId
    public void setUserId(Integer userId) {
    this.userId = userId;
    * Gets the username of this UserTable.
    * @return the username
    public String getUsername() {
    return this.username;
    * Sets the username of this UserTable to the specified value.
    * @param username the new username
    public void setUsername(String username) {
    this.username=username;
    * Gets the password of this UserTable.
    * @return the password
    public String getPassword() {
    return this.password;
    * Sets the password of this UserTable to the specified value.
    * @param password the new password
    public void setPassword(String password) {
    this.password=password;
    * Gets the userType of this UserTable.
    * @return the userType
    public String getUserType() {
    return this.userType;
    * Sets the userType of this UserTable to the specified value.
    * @param userType the new userType
    public void setUserType(String userType) {
    this.userType = userType;
    * Gets the accessLevel of this UserTable.
    * @return the accessLevel
    public String getAccessLevel() {
    return this.accessLevel;
    * Sets the accessLevel of this UserTable to the specified value.
    * @param accessLevel the new accessLevel
    public void setAccessLevel(String accessLevel) {
    this.accessLevel = accessLevel;
    * Gets the staffId of this UserTable.
    * @return the staffId
    public Integer getStaffId() {
    return this.staffId;
    * Sets the staffId of this UserTable to the specified value.
    * @param staffId the new staffId
    public void setStaffId(Integer staffId) {
    this.staffId = staffId;
    * Gets the staffType of this UserTable.
    * @return the staffType
    public String getStaffType() {
    return this.staffType;
    * Sets the staffType of this UserTable to the specified value.
    * @param staffType the new staffType
    public void setStaffType(String staffType) {
    this.staffType = staffType;
    * Gets the timeCreated of this UserTable.
    * @return the timeCreated
    public String getTimeCreated() {
    return this.timeCreated;
    * Sets the timeCreated of this UserTable to the specified value.
    * @param timeCreated the new timeCreated
    public void setTimeCreated(String timeCreated) {
    this.timeCreated = timeCreated;
    * Gets the timeModified of this UserTable.
    * @return the timeModified
    public String getTimeModified() {
    return this.timeModified;
    * Sets the timeModified of this UserTable to the specified value.
    * @param timeModified the new timeModified
    public void setTimeModified(String timeModified) {
    this.timeModified = timeModified;
    * Gets the timeLoggedIn of this UserTable.
    * @return the timeLoggedIn
    public String getTimeLoggedIn() {
    return this.timeLoggedIn;
    * Sets the timeLoggedIn of this UserTable to the specified value.
    * @param timeLoggedIn the new timeLoggedIn
    public void setTimeLoggedIn(String timeLoggedIn) {
    this.timeLoggedIn = timeLoggedIn;
    * Gets the timeLoggedOut of this UserTable.
    * @return the timeLoggedOut
    public String getTimeLoggedOut() {
    return this.timeLoggedOut;
    * Sets the timeLoggedOut of this UserTable to the specified value.
    * @param timeLoggedOut the new timeLoggedOut
    public void setTimeLoggedOut(String timeLoggedOut) {
    this.timeLoggedOut = timeLoggedOut;
    * Gets the createdBy of this UserTable.
    * @return the createdBy
    public String getCreatedBy() {
    return this.createdBy;
    * Sets the createdBy of this UserTable to the specified value.
    * @param createdBy the new createdBy
    public void setCreatedBy(String createdBy) {
    this.createdBy = createdBy;
    * Returns a hash code value for the object. This implementation computes
    * a hash code value based on the id fields in this object.
    * @return a hash code value for this object.
    @Override
    public int hashCode() {
    int hash = 0;
    hash += (this.userId != null ? this.userId.hashCode() : 0);
    return hash;
    * Determines whether another object is equal to this UserTable. The result is
    * <code>true</code> if and only if the argument is not null and is a UserTable object that
    * has the same id field values as this object.
    * @param object the reference object with which to compare
    * @return <code>true</code> if this object is the same as the argument;
    * <code>false</code> otherwise.
    @Override
    public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof UserTable)) {
    return false;
    UserTable other = (UserTable)object;
    if (this.userId != other.userId && (this.userId == null || !this.userId.equals(other.userId))) return false;
    return true;
    * Returns a string representation of the object. This implementation constructs
    * that representation based on the id fields.
    * @return a string representation of the object.
    @Override
    public String toString() {
    return "Entities.UserTable[userId=" + userId + "]";
    SLSB
    * UserTableFacade.java
    * Created on 31 March 2008, 16:07
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package Entities;
    import java.util.*;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    * @author Ayo
    @Stateless
    public class UserTableFacade implements UserTableFacadeLocal {
    @PersistenceContext
    private EntityManager em;
    /** Creates a new instance of UserTableFacade */
    public UserTableFacade() {
    public void create(UserTable userTable) {
    em.persist(userTable);
    public void edit(UserTable userTable) {
    em.merge(userTable);
    public void destroy(UserTable userTable) {
    em.merge(userTable);
    em.remove(userTable);
    public List findAll() {
    return em.createQuery("select Object(o)from UserTable as o").getResultList();
    local interface
    * UserTableFacadeLocal.java
    * Created on 31 March 2008, 16:07
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package Entities;
    import java.util.*;
    import javax.ejb.Local;
    * @author Ayo
    @Local
    public interface UserTableFacadeLocal {
    void create(UserTable userTable);
    void edit(UserTable userTable);
    void destroy(UserTable userTable);
    List findAll();
    controller servlet
    * userCheck.java
    * Created on 15 March 2008, 22:41
    package servlets;
    import Entities.UserTable;
    import Entities.UserTableFacadeLocal;
    import Entities.userValidationBean;
    import Entities.userValidationRemote;
    import java.io.*;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Collection;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.ejb.*;
    * @author Ayo
    * @version
    public class userCheck extends HttpServlet {
    @EJB
    private UserTableFacadeLocal userTableFacade;
    UserTable u;
    String userFellow;
    String pass;
    String username,password;
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    /*con=null;
    ps=null;
    rs=null;
    s=null;
    */response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    username=request.getParameter("username");
    password=request.getParameter("password");
    if(username==""||password=="")
    showError("<b><font color=\"red\">Please fill in the required blanks.</font></b>",request,response);
    else
    List user=userTableFacade.findAll();
    for(Iterator it=user.iterator();it.hasNext();)
    u=(UserTable)it.next();
    userFellow= u.getUsername();
    pass=u.getPassword();
    //out.println(" <b>"+elem.getTitle()+" </b><br />");
    //out.println(elem.getBody()+"<br /> ");
    //I used the following two lines to determing if im actually accessing the database and retrieving results, and I get all records in the table(usernames and passwords).
    //BUT I NEED A SPECIFIC RECORD TO MATCH THE USERNAME AND PASSWORD FROM THE FORM AND IF IT DOES NOT MATCH,I REDIRECT TO THE ERROR PAGE.THAT'S WHERE IM STUCK.
    out.println(userFellow);
    out.println(pass);
    /* if(username.equals(userFellow)&&password.equals(pass))
    RequestDispatcher d=request.getRequestDispatcher("blah.jsp");
    d.forward(request,response);
    else
    showError("<b><font color=\"red\">Invalid Login details!</font></b>",request,response);
    private void showError(String errorMsg,HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    request.setAttribute("error_msg",errorMsg);
    RequestDispatcher dispatcher=request.getRequestDispatcher("admin_error.jsp");
    dispatcher.forward(request,response);
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    // </editor-fold>
    I NEED HELP.ive been on this for 5 days and i cant seem to get a solution. I tried creating a method (private Collection findByUsername()) and(private Collection
    findByPassword()) in the local interface that would supposedly return records based on input from the form but I got a null pointer and an ejb exception saying
    unknown find method or something, as in ,or an error message that said i cant search records by name or something.I dont know. Or is it the query that is not
    specific enough. I didnt seem to get the syntax right when i was trying to search by username and password.Please someone help me.
    Ayo.

    Hey everyone,
    Is the question I posted that hard?
    I even tried to just load a HTML <img src="picture.jpg"/> tag
    on the login.jsp and even this won't show.
    I'm thinking that the container, with the security mechanism, is blocking
    styles and images???
    Anyone...please help.
    -Yuri

Maybe you are looking for