jdbc arbitrary attributes
- From: shya <uzumaki@xxxxxxxxxxxxxxx>
- Date: Sat, 23 Jul 2005 09:18:46 GMT
hi there! I'm new to jdbc programming, and I can't find an answer for my problem. Take for example this bunch of code:
protected void executeQuery( Connection con, String sqlStatement )
throws Exception { try {
Statement s = con.createStatement ( );
ResultSet rs = s.executeQuery( sqlStatement ); while ( rs.next ( ) ) {
String id = ( rs.getObject ("id").toString() );
String text = ( rs.getObject ("text").toString() ); System.out.println ( "found record : " + id + " " + text );
}rs.close ( );
} catch ( SQLException e ) {
System.out.println ( "Error executing sql statement" );
throw ( e );
}
}well, in this query, it retrives the attributes "id" and "text" from the result set. That's ok. But, how could I retrive _all_ the attributes in a particular ResultSet without know them before?
For instance, my executeQuery method should be perform query like:
SELECT NAME, SURNAME FROM TABLE1 WHERE etc...
or
SELECT * FROM TABLE1 WHERe ...
can you help me? thanks!
--
Shya .
- Follow-Ups:
- Re: jdbc arbitrary attributes
- From: John Currier
- Re: jdbc arbitrary attributes
- Prev by Date: Re: How To Execute DML and Anonymous PL/SQL block via JDBC?
- Next by Date: Re: jdbc arbitrary attributes
- Previous by thread: How To Execute DML and Anonymous PL/SQL block via JDBC?
- Next by thread: Re: jdbc arbitrary attributes
- Index(es):
Relevant Pages
|
|