I believe you'd just need the JDBC driver jars. I'm
connecting to Oracle from a servlet, and that's all
I'm using.
Installing the Oracle client SQL-Plus might be helpful
for working directly with the database tables, but
it's not necessary if someone else has already done
that for you.
You don't need TNSNAMES or the client - just the thin
driver URL, the same way you've spelled it out in the
example you provided.
I think the most current version of Oracle is 9.2.0.1.
MySQL is another flavor of database, so you don't need
that if you have Oracle. Each database will have its
own JDBC drivers, so you'll need to get them from the
database vendor for your version.
Just put the JDBC jars in the TOMCAT_HOME/common/lib
directory and you're good to go.
--- Jonathan Michael Nowacki <[EMAIL PROTECTED]>
wrote:
> Just wondering what kind of oracle programs do I
> need to get Tomcat to
> access an SQL database. I have servlets already
> written that work on
> another Sun OS machine that I still have access to.
> Is there a way I can
> query the OS to find out what versions of oracle are
> installed? The RPM
> command obviously doesn't work (since it is a Sun
> OS), and I don't have
> root permissions of course.
> If I can't query the Sun OS what versions of
> Oracle do you recommend.
> I tried browsing the oracle homepage and google
> searches but that just
> made me more confused from the vast number of
> choices. Also do I need
> sqlplus or JDBC if I have j2sdk, tomcat, and MySQL?
>
>
> This is whats already installed:
> -----------------------------------------------
> tomcat4-webapps-4.1.24-full.2jpp
> tomcat4-4.1.24-full.2jpp
> tomcat4-admin-webapps-4.1.24-full.2jpp
> j2re1.4.1_02
> j2sdkee1.4
> j2sdk1.4.1_02
> redhat 8
> standard MySQL that comes with Redhat 8 Linux
>
>
>
> Sample Servlet code that works on another computer
> ----------------------------------------------------
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.util.*;
> import java.sql.*;
> public class MultiServlet extends HttpServlet {
> /**
> * Initialize global variables
> */
> public void init(ServletConfig config) throws
> ServletException {
> super.init(config);
> }
> /**
> * Process the HTTP Post request
> */
> public void doPost(HttpServletRequest request,
> HttpServletResponse
> response)
> throws ServletException, IOException {
>
> String category =
> request.getParameter("category");
>
> response.setContentType("text/html");
> PrintWriter out = new PrintWriter
> (response.getOutputStream());
> out.println("<html>");
> out.println("<head><title>Advanced
> Search</title></head>");
> out.println("<body><table border=1 cellpadding =
> 5 cellspacing = 0>");
>
> try
> {
> System.out.println ("\n before registering driver
> \n");
> DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
> System.out.println (" before GET Connection \n");
> Connection conn = DriverManager.getConnection
>
("jdbc:oracle:thin:@dbserv.uits.indiana.edu:1521:OED1","s3jm013","s3jm013");
> System.out.println (" before STatement \n");
> Statement stmt = conn.createStatement();
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]