Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!

Avyaya Avi

Greenhorn
+ Follow
since Feb 04, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Avyaya Avi

So, does it mean You can not delete the file without Java 6 Update 7???

What if we face the same problem in earlier versions of Java?
11 years ago
"Code to hide the files"? In the sense that you wish to access the client machine and hide the files by changing the attributes???

I presume that this is not possible without varying implications.

You can not change the attributes of the files.
11 years ago
You NEED to call rs.next() in order to enter the result set values anyway.

What I suggest may be lame, but consider once and do let me know.

Move



to the top and execute.

Just a close call.
If you are working on the DB locally, then you can check the timeout settings and modify them in order to cope with the delay in the request calls.

If you are working on a remote DB m/c, then maintaining a consistent Connection is needed. If you are unsure about how to keep the connection consistent with your machine to the DB machine, then write a simple batch script which pings the DB server and keeps the Connection alive for your application to send a request.
11 years ago
Agree with Bauke.

As suggested, simple means would be to store the key/value pairs as seperate entities.
Get the values in a particular row using the SELECT query.

Check for the value in your code with the values retrieved from DB using the while loop.Simple.

If you are aware of the column name which hosts the value of yours, then retrieve only the values stored in that column rather than entire data in the table to reduce the overhead.
You need to refer and read the APIs at the least once when you start posting questions areound this forum.

Java Ranch is supposedly not an FAQ provider. Ranchers are supposed to help people stuck in some form or the other when coding comes.

If you need step by step instructions, then you better code once and before coding you read the basics of Java, JDBC once.
When you use a Statement, the query gets compiled everytime the statement is executed.

When you use a PreparedStatement, the query is compiled once and the compiled query will be reused no matter how many number of times you execute the PrepStmt.

All in all, it means using the PreparedStatement reduces the overhead for the compiler so that the queries run a bit mroe faster than they are supposed to be when a Statement is used.

Hope this helps!!!
Patil, you can update the resultset and store the same in DB using ResultSet.updateXxxx() functionalities.

Or else, if you wish to store the clob values in a bean in a String form, you can do so by calling

someBean.setSisRec("ResultSet objects holding the column values");
As you have posted this question in the JDBC section, I suppose that you are retrieving this values to be displayed in some JSP or in any Java file as a form of output.

So, wht I have in mind is, while retriving these values from the DB thru the resultset, you can concatenate them while placing them in the bean like:

someBean.setSisRec(rs.getString(COL_NAME1)+" " + rs.getString(COL_NAME2)+" " +rs.getString(COL_NAME3));

This would set the concatenated form of the values from the DB into the bean on which you can perform any more functionality related implementation.

Hope this helps!!
It just exemplifies a bean being set to the request attribute.

It's primary purpose if to serve the application request.So, the bean is being set into an attribute which carries the information in the bean to the next 'request-serving-code' or the code which would work on the info in the attribute on the server side and add some more details if required.
11 years ago