Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Ports

Re: Ports

From: ianal Vista <ianal_vista_at_hotmail.com>
Date: Sun, 23 Jul 2006 00:33:39 GMT
Message-ID: <Xns9808B2AAD97A5ianalvistahotmailcom@70.169.32.36>


"Learning As Much As I Can" <jctown_at_nb.sympatico.ca> wrote in news:1153610211.028681.65390_at_s13g2000cwa.googlegroups.com:

> I downloaded and installed the Oracle 10G Express Version on my
Windows
> XP Home PC. I can use sqlplus to connect to my database and query it.
> But I am trying to do the same thing using a JSP.
>
> Without trying to make my first post totally useless, I will try to
> provide some details... for those who have experience in these areas
> (JSP and Oracle).
>
> Here is a portion of my jsp
> --------------------------------------------------
> String queryString = "describe accounting_logs";
> // ---- configure this for your site
> String username = "system";
> String password = "xxxyyy";
> String url = "jdbc:oracle:thin:@localhost:8080:ORCL"; <---- is
> this wrong?
> %>
> <% // --------------- code for the service method --------------
> // Let's see if we got a request
> queryString = request.getParameter ("QUERYSTRING");
> if ((queryString != "") && (queryString != null)) {
>
> try {
> Class.forName("oracle.jdbc.driver.OracleDriver"); <--- or is
> this the problem?
> // Establish Connection to the database at URL with usename and
> password
> con = DriverManager.getConnection(url, username, password);
> // out.println ("Ok, connection to the DB is working.");
> } catch (Exception e) // (ClassNotFoundException and SQLException)
> {
> throw(new UnavailableException(this, "Sorry! The Database didn't
> load!"));
> }
> --------------------------------------
>
> When I execute the JSP (launched under Apache), I get an error message
> triggered by the UnavailableException. What I am thinking is that
> either my Class.forName is wrong or my url is wrong (or both). I
think
> that my PORT should be 1521 but I don't know what the database should
> be... and I can't seem to locate the name for it anywhere.
>
> I am only starting to learn this stuff... the reason I went to Oracle
> was because that's what we use at work and I wanted to be able to talk
> the same language.
>
>
> If anyone can help me I would appreciate it.
>
>

I am NOT a JAVA person, but I am a DBA who supports Java coders. IMO, what you have is NOT a JSP.
A JSP is similar to an ASP or a CGI.

What specifically do you "execute the JSP (launched under Apache)"? What is the URL?
How did you "register" the JSP with Apache?

It appears you are simply trying to use Java as client s/w to query Oracle. In that case you need to use port 1521 or what ever port the Oracle listener is configured to use.

>I can use sqlplus to connect to my database Please cut & paste EXACTLY how you invoked sqlplus, the query & results. Received on Sat Jul 22 2006 - 19:33:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US