RE: [JBoss-user] ResultSet or minerva.ResultSetInPool
getUnderLyingResultSet returns a java.sql.ResultSet, and if you are using racle then it returns oracle.jdbc.ResultSet or something like that, you have to look up the exact class. you get a classcast exception because you think it is a Minerva resultset. getUnderLyingResultSet returns the actual driver's result set, not minervas filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jose Ramon Diaz Sent: Thursday, April 19, 2001 10:42 AM To: JBOSS Mail List Subject: [JBoss-user] ResultSet or minerva.ResultSetInPool Hi, We are trying to obtain a ResultSet from an Oracle database. We find a trouble with Minerva types, We are using JBoss 2.2, with JDBC 2.0 and Oracle 8.1.7. We are using MinervaPool driver for the JDBC. In our configuration files, - jboss.jcml: We use 'org.jboss.minerva.xa.XADataSourceImpl' in the Pool configuration - jboss.properties: #jboss.xa.xidclass=oracle.jdbc.xa.OracleXid First, is OraclePool (oracle.jdbc.xa.client.OracleXADataSource) better than MinervaPool (org.jboss.minerva.xa.XADataSourceImpl) ? Second, When we try to execute a ResultSet from the EJB it throws: [noticiasAccesoBD] Exception in noticiasAccesoBD::obtenerNoticiasBoletin() [noticiasAccesoBD] java.lang.ClassCastException: org.opentools.minerva.jdbc.ResultSetInPool [noticiasAccesoBD] at es.westlaw.noticiasAccesoBDBean.obtenerNoticiasBoletin(Compiled Code) The code we use: l_query= "SELECT noticia FROM noticias"; l_pstmt = l_con.prepareStatement(l_query); l_rst = l_pstmt.executeQuery(); // which of the next two lines should be here?? // l_rst2 = ((org.jboss.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet() ; // JBOSS l_rst2 = ((org.opentools.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingR esultSet() ; // JBOSS while (l_rst2.next()) { l_noticiasCLOB = ((OracleResultSet)l_rst2).getCLOB(1); } Any help would be appreciated... Thanks in advance... Jose R. Juan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] ResultSet or minerva.ResultSetInPool
He's casting what was returned from executeQuery so that he can call getUnderLyingResultSet. Filip Hanik wrote: getUnderLyingResultSet returns a java.sql.ResultSet, and if you are using racle then it returns oracle.jdbc.ResultSet or something like that, you have to look up the exact class. you get a classcast exception because you think it is a Minerva resultset. getUnderLyingResultSet returns the actual driver's result set, not minervas filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jose Ramon Diaz Sent: Thursday, April 19, 2001 10:42 AM To: JBOSS Mail List Subject: [JBoss-user] ResultSet or minerva.ResultSetInPool Hi, We are trying to obtain a ResultSet from an Oracle database. We find a trouble with Minerva types, We are using JBoss 2.2, with JDBC 2.0 and Oracle 8.1.7. We are using MinervaPool driver for the JDBC. In our configuration files, - jboss.jcml: We use 'org.jboss.minerva.xa.XADataSourceImpl' in the Pool configuration - jboss.properties: #jboss.xa.xidclass=oracle.jdbc.xa.OracleXid First, is OraclePool (oracle.jdbc.xa.client.OracleXADataSource) better than MinervaPool (org.jboss.minerva.xa.XADataSourceImpl) ? Second, When we try to execute a ResultSet from the EJB it throws: [noticiasAccesoBD] Exception in noticiasAccesoBD::obtenerNoticiasBoletin() [noticiasAccesoBD] java.lang.ClassCastException: org.opentools.minerva.jdbc.ResultSetInPool [noticiasAccesoBD] at es.westlaw.noticiasAccesoBDBean.obtenerNoticiasBoletin(Compiled Code) The code we use: l_query= "SELECT noticia FROM noticias"; l_pstmt = l_con.prepareStatement(l_query); l_rst = l_pstmt.executeQuery(); // which of the next two lines should be here?? // l_rst2 = ((org.jboss.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet() ; // JBOSS l_rst2 = ((org.opentools.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingR esultSet() ; // JBOSS while (l_rst2.next()) { l_noticiasCLOB = ((OracleResultSet)l_rst2).getCLOB(1); } Any help would be appreciated... Thanks in advance... Jose R. Juan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user Confidential e-mail for addressee only. Access to this e-mail by anyone else is unauthorized. If you have received this message in error, please notify the sender immediately by reply e-mail and destroy the original communication. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] ResultSet or minerva.ResultSetInPool
The code we use: l_query= "SELECT noticia FROM noticias"; l_pstmt = l_con.prepareStatement(l_query); l_rst = l_pstmt.executeQuery(); // which of the next two lines should be here?? a) l_rst2 = ((org.jboss.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet(); // JBOSS b) l_rst2 = ((org.opentools.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet() ; // JBOSS while (l_rst2.next()) the easiest way to find out is to add this line System.out.println( l_rst2.getClass().getName() ); ^^ before line a) and b) I couldn't tell you on top of my head which one it is, but this will tell you Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of danch Sent: Thursday, April 19, 2001 11:17 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] ResultSet or minerva.ResultSetInPool He's casting what was returned from executeQuery so that he can call getUnderLyingResultSet. Filip Hanik wrote: getUnderLyingResultSet returns a java.sql.ResultSet, and if you are using ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] ResultSet or minerva.ResultSetInPool
Just use a simple ResultSet: Connection connection = ((DataSource)new InitialContext().lookup("java:comp/env/jdbc/DefaultDS")).getConnection(); Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery("SELECT count(*) from account"); - Original Message - From: "Jose Ramon Diaz" [EMAIL PROTECTED] To: "JBOSS Mail List" [EMAIL PROTECTED] Sent: Thursday, April 19, 2001 1:41 PM Subject: [JBoss-user] ResultSet or minerva.ResultSetInPool Hi, We are trying to obtain a ResultSet from an Oracle database. We find a trouble with Minerva types, We are using JBoss 2.2, with JDBC 2.0 and Oracle 8.1.7. We are using MinervaPool driver for the JDBC. In our configuration files, - jboss.jcml: We use 'org.jboss.minerva.xa.XADataSourceImpl' in the Pool configuration - jboss.properties: #jboss.xa.xidclass=oracle.jdbc.xa.OracleXid First, is OraclePool (oracle.jdbc.xa.client.OracleXADataSource) better than MinervaPool (org.jboss.minerva.xa.XADataSourceImpl) ? Second, When we try to execute a ResultSet from the EJB it throws: [noticiasAccesoBD] Exception in noticiasAccesoBD::obtenerNoticiasBoletin() [noticiasAccesoBD] java.lang.ClassCastException: org.opentools.minerva.jdbc.ResultSetInPool [noticiasAccesoBD] at es.westlaw.noticiasAccesoBDBean.obtenerNoticiasBoletin(Compiled Code) The code we use: l_query= "SELECT noticia FROM noticias"; l_pstmt = l_con.prepareStatement(l_query); l_rst = l_pstmt.executeQuery(); // which of the next two lines should be here?? // l_rst2 = ((org.jboss.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet() ; // JBOSS l_rst2 = ((org.opentools.minerva.jdbc.ResultSetInPool)l_rst).getUnderlyingResultSet() ; // JBOSS while (l_rst2.next()) { l_noticiasCLOB = ((OracleResultSet)l_rst2).getCLOB(1); } Any help would be appreciated... Thanks in advance... Jose R. Juan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user