  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Two phase commit transaction using WSAD5.0 and DB2 | Two phase commit transaction using WSAD5.0 and DB2 2005-04-27 - By Anuj Kumar
Back ? Hi All,
I am trying to implement (prototype) 2 phase commit transaction protocol using wsad5.1 and db2.i configured the DB2XADatasource provider in wsad and when i try yo run my program i get [4/27/05 11:27:13:296 GMT+05:30] 1accbc8a WebGroup E SRVE0026E: [Servlet Error]-[A]: java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc .WSJdbcDataSource at hello.A.getDataSource(A.java:196)
while looking up and casting the DB2XADatasource.
My method which is supposec to return DB2XADatasource is..
public static DB2XADataSource getDataSource(String jndiName) {
InitialContext ctx = null; DB2XADataSource db2Datasource = null; Connection conn = null;
try { ctx = new InitialContext();
db2Datasource = (DB2XADataSource) ctx.lookup(jndiName); } catch (NamingException ne) { ne.printStackTrace(); }
return db2Datasource ; }
}
can anyone Help me out ???
Thanks a lotttt Anuj
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<P> <BR> Hi All,<BR> <BR> I am trying to implement (prototype) 2 phase commit transaction protocol using wsad5.1 and db2.i configured the DB2XADatasource provider in wsad and when i try yo run my program i get <BR> [4/27/05 11:27:13:296 GMT+05:30] 1accbc8a WebGroup E SRVE0026E: [Servlet Error]-[A]: java.lang.ClassCastException: com.ibm.ws .rsadapter.jdbc.WSJdbcDataSource<BR> at hello.A.getDataSource(A.java:196)<BR> <BR> while looking up and casting the DB2XADatasource.<BR> <BR> My method which is supposec to return DB2XADatasource is..<BR> <BR> public static DB2XADataSource getDataSource(String jndiName) {<BR> <BR> InitialContext ctx = null;<BR> DB2XADataSource db2Datasource = null; <BR> Connection conn = null;<BR> <BR> try {<BR> ctx = new InitialContext();<BR> <BR> db2Datasource = (DB2XADataSource) ctx.lookup(jndiName);<BR> <BR> <BR> } catch (NamingException ne) {<BR> ne.printStackTrace( );<BR> }<BR> <BR> return db2Datasource ;<BR> }<BR> <BR> }<BR> <BR> can anyone Help me out ???<BR> <BR> Thanks a lotttt<BR> Anuj<BR> </P> <br><br> <A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"> <IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com /inbox.htm@(protected)" BORDER=0 VSPACE=0 HSPACE=0></a>
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <p>
|
|
 |