Executing SQL statement [message #593813] |
Tue, 11 November 2008 17:08 |
Eclipse User |
|
|
|
Originally posted by: andi.hotz.adsl.li
Up until now when I was interested in the contents of a table I accessed
the contents through an SQL statement using the java.sql.* package.
With DTP this is something like the flowing:
IConnectionProfile profile;
....
String sql = "select * from some_table";
Connection conn = (Connection)
profile.createConnection("java.sql.Connection").getRawConnection();
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()){
// something found found so do something
} else {
// nothing found so do something else
}
} catch (SQLException e){
e.printStackTrace();
}
I noticed there are classes/interfaces like
org.eclipse.datatools.modelbase.sql.query.impl.QuerySelectSt atementImpl.
How can I make use of this to access the data in my database table while
ignoring the underling connection infrastructure (JDBC connection will
only work if the data source driver is a JDBC driver).
So here is the question: How do I access my data in an abstract way?
I hope someone has some helpful thoughts.
Cheers
Andy
|
|
|
Powered by
FUDForum. Page generated in 0.02253 seconds