Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Executing SQL statement
Executing SQL statement [message #593813] Tue, 11 November 2008 17:08
Eclipse UserFriend
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
Previous Topic:Accessing table for MySQL database
Next Topic:Multiple Statement Delimiter
Goto Forum:
  


Current Time: Thu Apr 25 08:37:56 GMT 2024

Powered by FUDForum. Page generated in 0.02646 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top