Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] migrating jdbc queries to jpa native queries

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


Back to the top