This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi Thank you for reading my post. I need to retrive just one column of one rows of a table , so i need just one value . for example my statement is :
now i want to know , what is best way to execute and retrive the value total_login. should i create a ResultSet for this query or jdbc provide specefic querying for this condition.
Thank you for your helps. I thought there is some way to get just one value out of statement. i remember that there was such thing in .net .
but i looks like that in java land we must use a resultSet and bear its creation distruction fee :-)
Thanks again
Nguyen Van Huong
Greenhorn
Joined: Nov 28, 2011
Posts: 5
posted
0
Hi,
I am trying to create a function to return a string value, that is
I also tested the function but it wasn't sucess
error:
Nov 28, 2011 12:40:47 AM generateEmpID
SEVERE: null
java.sql.SQLException: ORA-00911: invalid character
Please UseCodeTags next time. See how much better your post looks with them. And it immediately pointed me to the ; inside your query. Remove that and try again.
raminaa niilian wrote:I thought there is some way to get just one value out of statement. i remember that there was such thing in .net .
but i looks like that in java land we must use a resultSet and bear its creation distruction fee :-)
The difference is in coding semantics, the same creation/destruction "fees" are incurred regardless of using Java or C#. If you find yourself using single-row result sets a lot, write your own SingleRowResultSet as a wrapper around ResultSet. Then your SingleRowResultSet wrapper can determine what to do when zero rows are returned, as Jeanne Boyarsky mentioned.
OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.