On Thu, 11 Nov 2004 08:33:39 -0600, "Robert r. Sanders"
<[EMAIL PROTECTED]> wrote:
>I believe you need to do something like:
>
> java.sql.Connection connection =
>persistenceBroker.serviceConnectionManager().getConnection();
> Statement statement = connection.createStatement();
> statement.executeUpdate(...);
>
>
Alternatively:
persistenceBroker.serviceJdbcAccess().executeUpdateSQL(
"INSERT INTO colors (color) VALUES ('red')",
persistenceBroker.getClassDescriptor(ColorV0.class));
Gerhard
>Anthony E. Carlos wrote:
>
>> Hello,
>>
>> How do I fire off a an arbitrary SQL statement that doesn't require a
>> return value?
>>
>> For example, (I already know how to do this using O/R mapping-- this
>> is just a simple example)
>>
>> INSERT INTO colors VALUES ('red');
>>
>> I've looked at the FAQs, but the only example is for SELECT
>> statements, which obviously return values.
>>
>> I've tried using
>>
>> String sql = "INSERT INTO colors (color) VALUES ('red')";
>> Query query = QueryFactory.newQuery(ColorVO.class, sql);
>>
>> I was using
>>
>> broker.getObjectByQuery(query);
>>
>> but it complains that I have an invalid column. The problem is, why do
>> I need "ColorVO.class" at all?
>>
>> I've also tried
>>
>> broker.getReportQueryIteratorByQuery(query);
>>
>> and it complains that I have an invalid SQL statement.
>>
>> So, is there any way to fire off arbitrary SQL without a return value?
>>
>> Thanks,
>>
>> -Anthony
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]