could we realize an insert query with hibernate. I read that must be a jdbc connection to the database if we want to insert into a table. think you.
+1
A:
To do a raw SQL insert, you'll need indeed to use the underlying JDBC connection of the Session
that you can get with session.connection()
:
Connection conn = session.connection();
// create a java jdbc statement
Statement statement = conn.createStatement();
statement.executeUpdate("INSERT INTO ...");
Pascal Thivent
2010-04-28 17:13:53