File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Converting String to ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Converting String to ResultSet" Watch "Converting String to ResultSet" New topic
Author

Converting String to ResultSet

Shweta Grewal
Ranch Hand

Joined: Apr 03, 2012
Posts: 39
Hi all,
Is it possible to convert String to ResultSet? Is there any function for this conversion?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

If the String is a valid SQL query, then maybe. Otherwise, no. What exactly are you trying to do?
Shweta Grewal
Ranch Hand

Joined: Apr 03, 2012
Posts: 39
If the String is a valid SQL query, then maybe

Can you elaborate a little bit.
Actually I am giving sql query as a string and getting the result as string, I want to convert thisString result to ResultSet.
Is it possible?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

The normal process is: get a JDBC connection to your database, use it to create a statement, use the statement to execute a query. That process returns a ResultSet. How are you running a query and getting back a String? Could you post a code sample?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Why do you want a ResultSet?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting String to ResultSet