The code will execute after. As you said in an earlier message, I can use my own 
DataSource implementation which does this anyway, and in fact I am doing that. I 
wanted to know if it was possible to get the JdO engine to do this immediately after a 
connection had been established.

By the way, which example has constructs like AVG, SUM etc.? I would also like to get 
an example of using CALL SQL. Which specific source example has this stuff?

Thanks,
Sunit 

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 22, 2004 12:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-user] Castor connections


Sunit,

will you be executing below code before or after a connection to the database has been 
made ? 

Werner

On Thu, 22 Jul 2004 07:57:15 -0600, Bruce Snyder wrote:

>
>Kavathekar, Sunit wrote:
>
>> Sorry about the html. It was  not intentional. The "module logon" I 
>> mentioned is just a stored procedure call that identifies the session 
>> to the db
owner (who may be monitoring usage). 
>> 
>> For example :
>> 
>>  private void logon(int db) throws SQLException {
>>         String appName              = System.getProperty("appName", "UnknownApp");
>>         String programName          = DB_MODULE_PREFIX + appName;
>>         String programParentName    = "";
>>         String programArguments     = "";
>> 
>>         CallableStatement logon = connections[db].prepareCall("begin 
>> module_logon(? , ? , ? , ? , ? , ?); end;");
>> 
>>         logon.setString(1, programName);
>>         logon.setString(2, programParentName);
>>         logon.setString(3, programArguments);
>>         logon.registerOutParameter(4, java.sql.Types.INTEGER);
>>         logon.registerOutParameter(5, java.sql.Types.INTEGER);
>>         logon.registerOutParameter(6, java.sql.Types.INTEGER);
>> 
>>         logon.execute();
>> 
>>        etc........... 
>
>Sunit,
>
>If you just need a java.sql.Connection, this is attainable from the 
>Castor Database object like so:
>
>     Connection conn = (Connection) 
> ((DatabaseImpl)_db).getConnection();
>
>Bruce
>--
>perl -e 'print
>unpack("u30","<0G)[EMAIL PROTECTED]&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");'
>
>The Castor Project
>http://www.castor.org/
>
>Apache Geronimo
>http://incubator.apache.org/projects/geronimo.html
>
>
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to 
>[EMAIL PROTECTED] with a subject of:
>        unsubscribe castor-user
>



-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a 
subject of:
        unsubscribe castor-user

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to