cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Lewis <jbryanle...@gmail.com>
Subject Re: Executing raw SQL
Date Tue, 04 Sep 2012 11:05:41 GMT
In you really need to get a connection, this has worked for me:

    Connection connection =
dataContext.getParentDataDomain().getNode("DataNode").getDataSource().getConnection()


On Mon, Sep 3, 2012 at 8:55 PM, Bob Harner <bobharner@gmail.com> wrote:


> Alternatively, how can I get access to the database connection so I can run
> straight JDBC?
>
> private void backUpDatabase(Connection conn) throws SQLException
> {
> String sqlstmt = "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(?)";
> CallableStatement cs = conn.prepareCall(sqlstmt);
> cs.setString(1,"D:/dbbackups/");
> cs.execute();
> cs.close();
> }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message