
January 3rd, 2002, 08:47 PM
|
|
Junior Member
|
|
Join Date: Dec 2000
Location: I'm in New England
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Do the same thing as a MySQL connection, just change the driver and url:
<%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags" prefix="sql" %>
<%-- open a database connection --%>
<sql:connection id="conn1">
<sql:url>jdbc:oracle:thin:@hostname:1521:databasename</sql:url>
<sql:driver>oracle.jdbc.driver.OracleDriver</sql:driver>
<sql:userId>scott</sql:userId>
<sql:password>tiger</sql:password>
</sql:connection>
<%-- open a database query --%>
<table>
<sql:statement id="stmt1" conn="conn1">
<sql:query>
select id, name, description from test_books
order by 1
</sql:query>
<%-- loop through the rows of your query --%>
<sql:resultSet id="rset2">
<tr>
<td><sql:getColumn position="1"/></td>
<td><sql:getColumn position="2"/></td>
<td><sql:getColumn position="3"/>
<sql:wasNull>[no description]</sql:wasNull></td>
</tr>
</sql:resultSet>
</sql:statement>
</table>
<%-- close a database connection --%>
<sql:closeConnection conn="conn1"/>
Are you using TOMCAT?
Have you added the Oracle JDBC driver to the web servers CLASS PATH? the jdbc driver is usually classes111.jar or classes12.jar.
If you still can't get it working, email me URL
thanks!'
'
[ t r o y ]
|