Thanks, guys, it worked perfectly:

        DataContext dataContext = DataContext.createDataContext();
        File backupDir = new File(System.getProperty("java.io.tmpdir"), 
"dbbackups");
        String query = "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE('D:/dbbackups/')";
        SQLTemplate template = new SQLTemplate(FooBar.class, query);
        dataContext.performNonSelectingQuery(template);


On Tue, Sep 4, 2012 at 7:05 AM, Bryan Lewis <[email protected]> wrote:
> 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 <[email protected]> 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();
>> }
>>

Reply via email to