Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 2nd, 2002, 11:08 AM
phast phast is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 2 phast User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
oracle/apache DBtags

I need some help connecting to my Oracle database using Apache Jakarta DBTags taglibs. Has anyone done this before. I found plenty of mySQL sample connections, but I modified it to no end to make it work with Oracle... no luck. Can anybody help?

Reply With Quote
  #2  
Old January 3rd, 2002, 08:47 PM
tcampano tcampano is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: I'm in New England
Posts: 4 tcampano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to tcampano
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 ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > oracle/apache DBtags

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap