RE: No suitable driver exception
Thanks for the advice, still not working. Getting a different Error when trying the EJB data source. ANy ideas? Exception in thread "main" java.lang.NullPointerException at com.evermind.sql.OrionPooledDataSource.ej(JAX) at com.evermind.sql.OrionPooledDataSource.d8(JAX) at com.evermind.sql.ak.eo(JAX) at com.evermind.sql.ak.ep(JAX) at com.evermind.sql.ap.createStatement(JAX) at Test.main(Test.java:33) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 11:14 PM To: Orion-Interest Subject: Re: No suitable driver exception Try: DataSource ds = (DataSource)ctx.lookup("jdbc/OracleDS"); instead of DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); regards /Theis.
RE: No suitable driver exception
Here's pieces of a test program I wrote about a year ago when we were looking at BMP - it's not great code, but it worked. This ran with Sybase and Hypersonic; the Sybase data-sources.xml section is below (the Hypersonic version was as-shipped with around 1.0). Hope this helps... Kirk Yarina /** * update a row in the database */ private void updateRow() throws FinderException { // if ( ! this.isModified ) return; String updateStatement = "UPDATE address set " + "addr1 = ?," + "addr2 = ?," + "addr3 = ?," + "city = ?," + "state = ?," + "zipcode = ?," + "country = ? " + "where id = ?"; Connection con = null; PreparedStatement ps = null; try { con = this.getConnection(); ps = con.prepareStatement(updateStatement); int ix = 1; ps.setString(ix++,this.addr1); ps.setString(ix++,this.addr2); ps.setString(ix++,this.addr3); ps.setString(ix++,this.city); ps.setString(ix++,this.state); ps.setString(ix++,this.zipcode); ps.setString(ix++,this.country); // where id = ? ps.setLong(ix,this.id); if (ps.executeUpdate() != 1) { throw new FinderException ("Store address.id "+this.id); } } catch (SQLException se) { se.printStackTrace( System.err ); throw new EJBException( "updateRow "+se.getMessage() ); } finally { try { if ( ps != null ) ps.close(); if ( con != null ) con.close(); } catch (Exception e) {}; // ignore SQLExceptions... } } private Connection getConnection() { String dsName = "jdbc/DefaultEJBDS"; // Pooled connections InitialContext initialContext = null; try { initialContext = new InitialContext(); } catch ( Exception ex ) { System.err.println( "-- Getting Initial Context --" ); ex.printStackTrace( System.err ); throw new EJBException ("getting address initialContext, " + ex.getMessage() ); } try { DataSource ds = (DataSource) initialContext.lookup( dsName ); return ds.getConnection(); } catch ( Exception ex ) { System.err.println ( "-- looking up DataSource '" + dsName + "' --" ); ex.printStackTrace( System.err ); throw new EJBException ( "looking up dsName '" + dsName + "', " + ex.getMessage() ); } - data-source name="Default data-source" class="com.evermind.sql.ConnectionDataSource" location="jdbc/DefaultDS" pooled-location="jdbc/DefaultPooledDS" xa-location="jdbc/xa/DefaultXADS" ejb-location="jdbc/DefaultEJBDS" url="jdbc:sybase:Tds:some.server.com:4100/somedb" connection-driver="com.sybase.jdbc2.jdbc.SybDriver" username="*" password="*" schema="database-schemas/sybase.xml" / At 11:19 AM 3/16/01 -0800, you wrote: Thanks for the advice, still not working. Getting a different Error when trying the EJB data source. ANy ideas? Exception in thread "main" java.lang.NullPointerException at com.evermind.sql.OrionPooledDataSource.ej(JAX) at com.evermind.sql.OrionPooledDataSource.d8(JAX) at com.evermind.sql.ak.eo(JAX) at com.evermind.sql.ak.ep(JAX) at com.evermind.sql.ap.createStatement(JAX) at Test.main(Test.java:33) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 11:14 PM To: Orion-Interest Subject: Re: No suitable driver exception Try: DataSource ds = (DataSource)ctx.lookup("jdbc/OracleDS"); instead of DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); regards /Theis.
No suitable driver exception
Having a problem accessing JDBC Connection through a datasource, and can't figure it out with orion. Any help would be greatly appreciated. Here are the details, and am using Oracle 8i. * classes12.zip located in the orion/lib dir. * Here is my datasources xml snippet. data-source class="com.evermind.sql.DriverManagerDataSource" name="Oracle" location="jdbc/OracleCoreDS" xa-location="jdbc/OracleXADS" ejb-location="jdbc/OracleDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="" password="" url="jdbc:oracle:thin:@server:1521:ORCL" inactivity-timeout="30" / * Orion starts up fine. * Here is the code... (no app-client xml file) env.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory"); env.put("java.naming.provider.url", "ormi://localhost/default"); env.put("java.naming.security.principal","admin"); env.put("java.naming.security.credentials","kb143aj"); InitialContext ctx = new InitialContext(env); DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); Connection conn = ds.getConnection(); Statement stmt = conn.createStatement(); * Running with orion.jar, jndi.jar, jdbc.jar, classes.zip * Getting No suitable driver exception (SQLException) at Connection conn = ds.getConnection(); Any help would be greatly appreciated. =) Thanks, Greg
RE: No suitable driver exception
try classes111.zip...your 8i may not be patched to a level that accepts classes12 Sometimes works when nothing else does -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Gregory Kaestle Sent: Thursday, March 15, 2001 8:17 PM To: Orion-Interest Subject: No suitable driver exception Having a problem accessing JDBC Connection through a datasource, and can't figure it out with orion. Any help would be greatly appreciated. Here are the details, and am using Oracle 8i. * classes12.zip located in the orion/lib dir. * Here is my datasources xml snippet. data-source class="com.evermind.sql.DriverManagerDataSource" name="Oracle" location="jdbc/OracleCoreDS" xa-location="jdbc/OracleXADS" ejb-location="jdbc/OracleDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="" password="" url="jdbc:oracle:thin:@server:1521:ORCL" inactivity-timeout="30" / * Orion starts up fine. * Here is the code... (no app-client xml file) env.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory"); env.put("java.naming.provider.url", "ormi://localhost/default"); env.put("java.naming.security.principal","admin"); env.put("java.naming.security.credentials","kb143aj"); InitialContext ctx = new InitialContext(env); DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); Connection conn = ds.getConnection(); Statement stmt = conn.createStatement(); * Running with orion.jar, jndi.jar, jdbc.jar, classes.zip * Getting No suitable driver exception (SQLException) at Connection conn = ds.getConnection(); Any help would be greatly appreciated. =) Thanks, Greg
Re: No suitable driver exception
Try: DataSource ds = (DataSource)ctx.lookup("jdbc/OracleDS"); instead of DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); regards /Theis.