Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic getXXX and setXXX methods

843854Dec 13 2002 — edited Dec 16 2002
Has anyone ever dynamically created and called a statement like this?:

int first = rset.getInt(1);
- or -
insertStmt.setString(2, second);

I am working on a Java program that has to dynamically build a select statement based on the number of columns in the table (which is passed in). However, the problem is I can't hardcode the individual getXXX and setXXX calls because I will not know the column types beforehand(I have their names stored in an array that is generated). I was wondering if anyone has done something like this. Any help would be appreciated!

Thanks,
Jon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2003
Added on Dec 13 2002
7 comments
3,192 views