I am developing android application. In my application i have used sql server2008 R2. I am inserting the row in the sql server on some click event. Now i want to fetch the first column's value from the newly inserted row. The first column's value of that schema is auto generated.I am inserting the value from the second column in my insert query. I am using jdbc. In .net to achieve this functionality method ExecuteScalar() is der. But what in java. I have done lots of googling but haven't found any thing. Help me if you the solution.
Asked
Active
Viewed 180 times
-1
-
2You may find this question helpful, http://stackoverflow.com/questions/1915166/how-to-get-the-insert-id-in-jdbc – Kevin D Sep 21 '11 at 09:11
-
http://stackoverflow.com/questions/45651/sql-how-to-get-the-id-of-values-i-just-inserted – Samir Mangroliya Sep 21 '11 at 09:18
-
@Divyesh: I think this answer is for VB.Net not for java. – Kushal Shah Sep 21 '11 at 10:00
1 Answers
0
As per request to move comment to an answer.
You may find this question helpful. How to get the insert ID in JDBC?