• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in accesing a db from a servlet

 
rammie singh
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every body

first i will give you the code of my function.



here the function is not entering in 2nd while loop.
and is giving java.sql.SQLException

and when i do like this




it enters the 2nd while loop but it gives error as
java.lang.NullPointerException

and it also prints hi.


here EmpJavaBean is my bean class where i am all the function of getters and setters.


although i am getting the desired result when i am doing only this




it means my java bean functions are working fine.

emp is object of my bean class.

still i will give you the code for my second function in the bean class EmpJavaBean.






here my main aim is that on making the privileges query that is

"select PRIVILEGES from PRIVILEGE where EMP_ID= '"+empid+"'";

i would be getting 3 to 4 rows of different privileges which i want to set in the emp object privileges which is represented by an

ArrayList empPrivilege

can any body please help me why i am getting this error.

i hope my problem is clear.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

here the function is not entering in 2nd while loop.
and is giving java.sql.SQLException

What does the SQLException message say?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic