aspose file tools*
The moose likes JDBC and the fly likes last generated slno Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "last generated slno" Watch "last generated slno" New topic
Author

last generated slno

preethi Ayyappan
Ranch Hand

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

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.

Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36468
    
  16
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.

CR
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: last generated slno
 
Similar Threads
Trying to grab the last record.
nested ResultSets
Trying to grab the last record.
datas storing twice from servlet to mysql database
how to select 2nd,3rd or the Nth highest salary from a table in desc or ascen order?