If I understand what you want...
Here is some code that merely gets the connection in a JSP, using the
DataSource.
<%@ page import="java.sql.*, javax.sql.DataSource,
javax.naming.InitialContext" %>
<jsp:useBean class="employeeInfoBean" id="employeebean" scope="page"/>
<html>
<head>
<title>Employee Information</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<%
DataSource ds = null;
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
InitialContext ctx = new InitialContext();
ds = (DataSource)ctx.lookup("jdbc/PooledDs");
con = ds.getConnection();
out.println("Got a connection!");
con.close()
out.println("Closed the connection!");
}
catch(Exception e) {
try {
if( rs != null) rs.close();
if( ps != null) ps.close();
if(con != null) con.close();
}
catch(Exception ee) {}
}
%>
</body>
</html>
----------------------------------------------------------
Allen L. Fogleson
Senior Project Manager Crunchy Technologies
2111 Wilson Boulevard Suite 350
Arlington, Va 22201
voice: (703) 469-2032
pager: (800) 826-3181
www.crunchy.com <http://www.crunchy.com>
Is your business soggy or is it Crunchy?
----------------------------------------------------------
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Roland Dong
Sent: Sunday, March 25, 2001 1:43 PM
To: Orion-Interest
Subject: RE: problem running oracle with orion:
'oracle.jdbc.driver.OracleDriver' not found!
Thanks everybody for helping me with this problems. It works now! However, I
could not have the jsp example code work! Could someone send me a jsp code
just for the purpose of testing the connection between Orion and Oracle?
Thanks!
Roland
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of denis despinoy
Sent: Saturday, March 24, 2001 11:09 AM
To: Orion-Interest
Subject: Re: problem running oracle with orion:
'oracle.jdbc.driver.OracleDriver' not found!
Hi,
Just copy classes12.zip (Oracle jdbc driver) in your
orion/lib directory - just alongside HypersonicSQL
driver hsql.jar...
In Orion/config/data-sources.xml u can setup the
DataSource lookup along with the url,database name usr
and pwd and instance of the database u ref etc...
Post if u need a copy of my data-sources.xml !
denis
--- Roland Dong <[EMAIL PROTECTED]> wrote:
>
>
> I tried to run oracl with orion. When I started
> orion I got the following
> error message:
>
> Error initializing server: DriverManagerDataSource
> driver
> 'oracle.jdbc.driver.OracleDriver' not found. Where
> is driver supposed to
> be located? I have set the environment so that the
> class12.zip is included
> in the classpath.
>
> Should
> class="com.evermind.sql.DriverManagerDataSource"
> include
> OracleDriver?
>
> this is my data-source.xml:
>
> <?xml version="1.0"?>
> <!DOCTYPE data-sources PUBLIC "Orion data-sources"
> "http://www.orionserver.com/dtds/data-sources.dtd">
>
> <data-sources>
> <!--
> An example/default DataSource that uses an
> ordinary
> JDBC-driver (in this case hsql) to create the
> connections.
> This tag creates all the needed kinds
> of data-sources, transactional, pooled and
> EJB-aware sources.
> The source generally used in application code is
> the "EJB"
> one - it provides transactional safety and
> connection pooling.
> -->
>
> <data-source
> class="com.evermind.sql.DriverManagerDataSource"
> name="Oracle"
> location="jdbc/OracleCoreDS"
> xa-location="jdbc/xa/OracleEJBDS"
> ejb-location="jdbc/Oracle"
>
> connection-driver="oracle.jdbc.driver.OracleDriver"
> username="scott"
> password="tiger"
> url="jdbc:oracle:thin:@uxb.wiu.edu:1521:uxora"
> inactivity-timeout="30"
> />
>
> </data-sources>
>
>
> Please help!
>
> Roland
>
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/