Re: How to find out the type of application Server at Runtime

Alex Paransky <[email protected]> Wed, 7 Apr 2004 14:07:15 -0700
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <[email protected]>
Wouldn't you get a ClassNotFound exception when trying to run under
JBOSS using the weblogic.jdbc.common.OracleClob in your code?   I think
you need to use introspection.

-AP_
Chester Chen wrote:

>Thanks for all the replies.  I guess there is no Metadata to work with.
>
>the instanceof operator works for me.
>
>Thanks
>
>
>Chester
>
>
>
>>-----Original Message-----
>>From: Siarhei Adzinets [mailto:[email protected]]
>>Sent: Tuesday, April 06, 2004 11:45 PM
>>To: [email protected]
>>Subject: Re: How to find out the type of application Server at Runtime
>>
>>
>>Hi, Chester,
>>
>>I suggest you using instanceof operator.
>>Something like this:
>>
>>Clob clob = rs.getClob(1);
>>if(clob instanceof oracle.sql.CLOB)
>>      outStream = ((oracle.sql.CLOB)clob).getCharacterOutputStream();
>>else
>>       outStream =
>>((weblogic.jdbc.common.OracleClob)clob).getCharacterOutputStream();
>>
>>
>>Best regards,
>>Siarhei Adzinets
>>
>>----- Original Message -----
>>From: "Chester Chen" <[email protected]>
>>To: <[email protected]>
>>Sent: Tuesday, April 06, 2004 10:37 PM
>>Subject: How to find out the type of application Server at Runtime
>>
>>
>>
>>
>>>Hi,
>>>    Is there a way to find out the type of application server
>>>for example: Weblogic, JBOSS or Web Server, at runtime from code ?
>>>
>>>    Some sort of Application Server Metadata will help.
>>>
>>>    I am adding LOB support for Application Server. As the
>>>weblogic needs special JDBC Oralce extension for Oralce
>>>
>>>
>>Thin driver (for
>>
>>
>>>retrieving LOB) , I need
>>>to cast the proper class at run time for different
>>>
>>>
>>application Servers.
>>
>>
>>>   Any suggestions ?
>>>
>>>   Also, an related question: Does JBOSS or WebSphere need
>>>
>>>
>>JDBC extensions
>>
>>
>>>for Oracle Thin Driver ?
>>>   Some example or some pointers are appreciated
>>>
>>>
>>>Thanks
>>>
>>>Chester
>>>
>>>
>>>
>>>
>>==============================================================
>>=============
>>
>>
>>>To unsubscribe, send email to [email protected] and
>>>
>>>
>>include in the
>>body
>>
>>
>>>of the message "signoff EJB-INTEREST".  For general help,
>>>
>>>
>>send email to
>>
>>
>>>[email protected] and include in the body of the message "help".
>>>
>>>
>>==============================================================
>>=============
>>To unsubscribe, send email to [email protected] and
>>include in the body
>>of the message "signoff EJB-INTEREST".  For general help,
>>send email to
>>[email protected] and include in the body of the message "help".
>>
>>
>>
>
>===========================================================================
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[email protected] and include in the body of the message "help".
>
>
>

--
-AP_
http://www.myprofiles.com/member/profile/apara_personal
http://www.myprofiles.com/member/profile/apara_business

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".