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...
Type: Posts; User: wrightkevin
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...
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...
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("...
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?
...
Hi Brane,
We found your NullPointerException!!!!!
Your loop while(results.next) should be while( rs.next() )
Try that and let me know....
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....
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.
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...
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
Here is the logic you need:
String studentID = "12";
String relation = "LESS THAN";
int nStudentId = Integer.parseInt(studentID);
String strQuery =...
[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...
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...
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...
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...
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...
Where to start? Can you currently select anything at all from your database? How are you connecting?