• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in accesing a db from a servlet

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

reply
    Bookmark Topic Watch Topic
  • New Topic