[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[eclipselink-users] migrating jdbc queries to jpa native queries
|
- From: Yannick Majoros <yannick.majoros@xxxxxxxxxxxx>
- Date: Tue, 07 Jul 2009 13:33:04 +0200
- Delivered-to: eclipselink-users@eclipse.org
- Organization: UCLouvain
- User-agent: Thunderbird 2.0.0.22 (Windows/20090605)
Hi,
Is there a simple way to migrate code like this to jpa/eclipselink?
// get connection, statement
ResultSet rs = statement.executeQuery(maCommande);
while (rs.next()) {
String code = rs.getString("code_etude");
// ...
}
In order to use jpa-provided connection pools, to have all statements
closed in all cases without try-finally blocks, ...
Is there a simple solution? Native queries return an array with unnamed
columns, we really want to use methods like
rs.getString("my_column_name"). We can't use SqlResultSetMapping, as the
queries are too complex to be mapped.
Yannick