Search:

Type: Posts; User: wrightkevin

Search: Search took 0.08 seconds.

  1. Replies
    17
    Views
    2,462

    [SOLVED] Re: The 'new' Keyword

    All you have done is declared a local variable (which ought to point to something but doesnt). I disagree with a previous answer stating it is set to null. Because your reference is local it does not...
  2. Replies
    3
    Views
    1,570

    Re: Beginner: some questions

    Er, sounds kind of ambitious to me for a first Java project. You could look at Servlets and JSP for a web application, or maybe JavaFX (which I know next to nothing about, maybe others can comment on...
  3. Re: I need to create a certain SHAPE with FOR LOOP.

    Hiya,

    is this answer too obvious?


    public static void main(String[] args) {
    // TODO Auto-generated method stub
    for(int i=0; i<5; i++){
    if (i % 2 == 0)
    System.out.println("...
  4. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Hi Brane,

    Either your getAttribute("studentList") is returning a null or an
    empty list is being passed from the Servlet. Can you insert the code
    I have suggested, and tell me what happens?
    ...
  5. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Hi Brane,

    We found your NullPointerException!!!!!

    Your loop while(results.next) should be while( rs.next() )

    Try that and let me know....
  6. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    One thing I did notice about your code... You are only selecting two columns name, and studentid
    I think, but when processing the resultset you are requesting a third and fourth column.

    i.e....
  7. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Hi Brane, gosh this getting messy. Can you determine which line of code
    is giving you a NullPointerException? Once I know that I should be able to help.
  8. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Hi Brane,

    After a bit of playing with Access, and its been a while :)

    try this instead (with a val function around studentid)


    String studentID = "12";
    String relation = "LESS THAN";
    int...
  9. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Ah, that tells me that your studentid column is some text type and not a numeric type as i had assumed. I'll get back to you on that once i've seen how to work with access char types
  10. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Here is the logic you need:


    String studentID = "12";
    String relation = "LESS THAN";
    int nStudentId = Integer.parseInt(studentID);
    String strQuery =...
  11. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    [QUOTE=wrightkevin;72247]Hi,
    I'm sorry I cannot just fix your program for you. The problem with your code is that the sql string that you is building up is just wrong. Try printing it out (with a...
  12. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Hi,
    I'm sorry I cannot just fix your program for you. The problem with your code is that the sql string that you is building up is just wrong. Try printing it out (with a System.out.println as...
  13. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    I dont want to give you the complete answer but what do you think the following would do?
    strEmp="select whatever from yourtable where empid='" + strempid + "'"
    See how tricky it is to embed data...
  14. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Your code is building up a string called sqlQuery.just before you call executeQuery.(You are calling execute query right?) Do a
    System.out.println(sqlQuery);
    the output should show up in your...
  15. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Ok, but there is a lot of code you havent shown. Where is your statement object for example. It might be worth you printing out your sql statement to the screen, just before you call executeQuery on...
  16. Replies
    20
    Views
    3,883

    Re: "Search Form" JSP-SERVLET USING NETBEANS

    Where to start? Can you currently select anything at all from your database? How are you connecting?
Results 1 to 16 of 16