SV: R: R: frustrated - jdbc: No suitable driver

2001-01-31 Thread Klaus . Myrseth

You will have to define the jdbc connection in the datasource configuration
file on the appserver though.

The client should never use any jdbc directly :)

The Entity beans can be mapped using cmp or bmp and the lookup through the
JNDI context for the suitable connection instance is
done through the J2EE context classes as explained by Burr..
A normal method to do this is (inside an EJB in this example):
Connection conn = null;
try {
InitialContext ic = new InitialContext();
/* Here is the JNDI name...check orions data-sources.xml
 * file in the config directory to see examples with hsql
 */And note that you should prolly choose to use the pooled-location
name
DataSource ds (DataSource)ic.lookup("jdbc/ProdObjectSpacePooledDS");

conn = ds.getConnection();
} catch (Exception ex) {
throw new EJBException(ex);
}

// .. do some JDBC stuff

conn.close();

Hope this helps you further :=)

Have fun!!

Klaus Myrseth



-Opprinnelig melding-
Fra: Burr Sutter [mailto:[EMAIL PROTECTED]]
Sendt: 31. januar 2001 15:21
Til: Orion-Interest
Emne: Re: R: R: frustrated - jdbc: No suitable driver


Hey Tom,

Potentially silly question (somewhat new to Orion but I've used a few other
app.  servers). Are you basically saying that the use of a
javax.sql.DataSource acquried via a call to InitialContext.lookup() means I
don't need a JDBC Driver on a remote client machine (end-user's desktop)?

I was unaware that this trick would work. I've always tried to push all
database access to session beans, servlets or server-RMI objects.

Thanks,
Burr
[EMAIL PROTECTED]
- Original Message -
From: Tom Mitchell [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Tuesday, January 30, 2001 9:28 PM
Subject: Re: R: R: frustrated - jdbc: No suitable driver


Jeff,

I disagree.  Part of the benefit of a DataSource is that it can abstract
the actual driver or database being used.  If I can ask a DataSource for
a database connection and not have to care about which client-side
driver to load, and (less practically), even what rdbms i am using.
That way, the app server can change databases, drivers, even vendors
without its clients being aware.

I experienced this issue porting an app from WebLogic.  I used the same
schema and sql with SQL Server and Postgres on WebLogic.  My client
application (which both queried and populated the database) never
changed.  It just got a Context from the app server, gfot a DataSource
by name, then got plain old JDBC Connections from there.  No JDBC
drivers at all.

I think that is a useful layer.

PS: I have unsubscribed from the list - if you would like to continue
the discussion, please reply to my personal address.

Thanks for your thoughts.

I appreciate your point of view, I just disagree with it.

Jeff Schnitzer wrote:

 If the client is going to use the JDBC driver, it must be able to load
 the class(es).  This means you need to package the driver with the
 client application.  I'm puzzled by your comments about clients not
 needing to care about drivers - are these classes just going to
 materialize out of thin air?  I suppose in theory the server could do
 something with http classloading, but why bother with the extra
 complexity, security considerations, and licensing issues?  You know
 you're going to need the classes anyways, package them with the client.

 Jeff

 -Original Message-
 From: Tom Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 30, 2001 9:08 AM
 To: Orion-Interest
 Subject: Re: R: R: frustrated - jdbc: No suitable driver
 
 
 Again, thanks for your replies.
 
 What is curious to me is that the driver performs fine within a jsp.  I
 look up loc with no problem.
 
 It only has a problem from a client application.  And, it does not seem
 like a client to a DataSource should ever have to care about drivers -
 that is the container's job in my opinion.
 
   data-source
 class="com.evermind.sql.ConnectionDataSource"
 name="SomeDatasource"
 location="loc"
 xa-location="jdbc/xa/SomeXADS"
 ejb-location="ejb/weather"
 schema="database-schemas/postgresql.xml"
 connection-driver="org.postgresql.Driver"
 username="tom"
 password="tR16/4"
 url="jdbc:postgresql://192.168.1.5:5432/weather"
 inactivity-timeout="30"
/
 
 Any more ideas?
 
 DeVincentiis Giustino wrote:
 
  Sorry, the message "No suitable driver" probably means a
 problem with jdbc
  driver.
  So if you have into the data-sources.xml the definition:
 
  data-source
  class="com.evermind.sql.DriverManagerDataSource"
  name="Hypersonic"
  location="jdbc/HypersonicCoreDS"
  xa-location="jdbc/xa/HypersonicXADS"
  ejb-location="jdbc/HypersonicDS"
  connection-driver="org.hsql.jdbcDriver"
  username="sa"
  

SV: R: R: frustrated - jdbc: No suitable driver

2001-01-31 Thread Klaus . Myrseth

Ofcourse if you use this in an Entity bean pls use the EJB connection :)

Sorry just aditional information - forgot this on the first letter :)

Klaus

-Opprinnelig melding-
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sendt: 31. januar 2001 16:19
Til: Orion-Interest
Emne: SV: R: R: frustrated - jdbc: No suitable driver


You will have to define the jdbc connection in the datasource configuration
file on the appserver though.

The client should never use any jdbc directly :)

The Entity beans can be mapped using cmp or bmp and the lookup through the
JNDI context for the suitable connection instance is
done through the J2EE context classes as explained by Burr..
A normal method to do this is (inside an EJB in this example):
Connection conn = null;
try {
InitialContext ic = new InitialContext();
/* Here is the JNDI name...check orions data-sources.xml
 * file in the config directory to see examples with hsql
 */And note that you should prolly choose to use the pooled-location
name
DataSource ds (DataSource)ic.lookup("jdbc/ProdObjectSpacePooledDS");

conn = ds.getConnection();
} catch (Exception ex) {
throw new EJBException(ex);
}

// .. do some JDBC stuff

conn.close();

Hope this helps you further :=)

Have fun!!

Klaus Myrseth



-Opprinnelig melding-
Fra: Burr Sutter [mailto:[EMAIL PROTECTED]]
Sendt: 31. januar 2001 15:21
Til: Orion-Interest
Emne: Re: R: R: frustrated - jdbc: No suitable driver


Hey Tom,

Potentially silly question (somewhat new to Orion but I've used a few other
app.  servers). Are you basically saying that the use of a
javax.sql.DataSource acquried via a call to InitialContext.lookup() means I
don't need a JDBC Driver on a remote client machine (end-user's desktop)?

I was unaware that this trick would work. I've always tried to push all
database access to session beans, servlets or server-RMI objects.

Thanks,
Burr
[EMAIL PROTECTED]
- Original Message -
From: Tom Mitchell [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Tuesday, January 30, 2001 9:28 PM
Subject: Re: R: R: frustrated - jdbc: No suitable driver


Jeff,

I disagree.  Part of the benefit of a DataSource is that it can abstract
the actual driver or database being used.  If I can ask a DataSource for
a database connection and not have to care about which client-side
driver to load, and (less practically), even what rdbms i am using.
That way, the app server can change databases, drivers, even vendors
without its clients being aware.

I experienced this issue porting an app from WebLogic.  I used the same
schema and sql with SQL Server and Postgres on WebLogic.  My client
application (which both queried and populated the database) never
changed.  It just got a Context from the app server, gfot a DataSource
by name, then got plain old JDBC Connections from there.  No JDBC
drivers at all.

I think that is a useful layer.

PS: I have unsubscribed from the list - if you would like to continue
the discussion, please reply to my personal address.

Thanks for your thoughts.

I appreciate your point of view, I just disagree with it.

Jeff Schnitzer wrote:

 If the client is going to use the JDBC driver, it must be able to load
 the class(es).  This means you need to package the driver with the
 client application.  I'm puzzled by your comments about clients not
 needing to care about drivers - are these classes just going to
 materialize out of thin air?  I suppose in theory the server could do
 something with http classloading, but why bother with the extra
 complexity, security considerations, and licensing issues?  You know
 you're going to need the classes anyways, package them with the client.

 Jeff

 -Original Message-
 From: Tom Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 30, 2001 9:08 AM
 To: Orion-Interest
 Subject: Re: R: R: frustrated - jdbc: No suitable driver
 
 
 Again, thanks for your replies.
 
 What is curious to me is that the driver performs fine within a jsp.  I
 look up loc with no problem.
 
 It only has a problem from a client application.  And, it does not seem
 like a client to a DataSource should ever have to care about drivers -
 that is the container's job in my opinion.
 
   data-source
 class="com.evermind.sql.ConnectionDataSource"
 name="SomeDatasource"
 location="loc"
 xa-location="jdbc/xa/SomeXADS"
 ejb-location="ejb/weather"
 schema="database-schemas/postgresql.xml"
 connection-driver="org.postgresql.Driver"
 username="tom"
 password="tR16/4"
 url="jdbc:postgresql://192.168.1.5:5432/weather"
 inactivity-timeout="30"
/
 
 Any more ideas?
 
 DeVincentiis Giustino wrote:
 
  Sorry, the message "No suitable driver" probably means a
 prob