Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases and the fly likes last generated slno Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "last generated slno" Watch "last generated slno" New topic

last generated slno

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
I need to get the last generated serial numberfrom my sql database.I tried the following my sql query directly in is working.but when i use this in my servlet program,it is showing error.


column usr_login_time not found

my database is correct and i am having the field usr_login_time in table time.when i use some other query like

I am able to print the time.I dont know why MAX(slno) is not working in my servlet code.

please help me to solve this.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45276
You aren't selecting usr_login_time in your query.

I think this thread would sit better in the JDBC forum, so I shall move it there.

I agree. Here's the link:
subject: last generated slno
It's not a secret anymore!