[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

How i can connect my website to sql & oracal databsase

hi expert, i am new in web programming and design ..
i want to lean how to do only one webpage and retreive records from my sql database or oracal any one which will be faster.
but i don't know what setup/software do i need to connect my webpage with the data base in another pc which has a static ip address.

what i think i need interface to recive the client request execute the command by fetching the data from the database and send it back to the client..
is there any direct why.
where i can read the records from my database directly, when the client click on a command botton.. so i just open a connection to databse and select what ever data i want and display the data on new page. or what ever.
thanks
0
volanto
Asked:
volanto
1 Solution
 
bochgochCommented:
You'll need to create a DAD to your database (the connection from mod_plsql to the database) within which your storing your PLSQL, if you've got an Application Server (9IAS or AS10g) then:

Login to Enterprise Manager (http://your.server.name:1810) as ias_admin. Navigate to your HTTP Service (Farm > App Server > HTTP Server > PL/SQL Properties (at the bottom of the screen)) -- scroll down to DAD Status and click Create -- select general as connection type, enter connection string as usual and give your DAD a name (you'll need this as DADname in the URL below).

If your just using the database the you'll need to have Apache running on it, then goto http://hostname:80 & click mod_plsql. This reference will guide you through creation of a DAD:
http://www.oracle.com/technology/products/oracle9i/htdocs/9iobe/OBE9i-Public/obe-mng/html/9iAShttpconf/9iAShttpconf.htm

Once you have a DAD, then create a procedure on that database, example:

CREATE OR REPLACE PROCEDURE "HELLOWORLDPROC" AS
BEGIN NULL;
htp.prn('
     <HTML>
     <HEAD><TITLE>HELLO WORLD</TITLE></HEAD>
     <BODY>
     <br><br>
     <B>
     There are currently
');

for counter in (SELECT COUNT(*) rowsintable FROM DUAL) loop
     htp.prn(' ');
     htp.prn( counter.rowsintable );
     htp.prn(' ');
end loop;

htp.prn(' rows in TABLE1
     </BODY>
     </HTML>
');
 END;
/

Once this has been created you can access it using the following URL syntax:

http://your.server.name:7778/DADname/HELLOWORLDPROC

This demonstrates several things:

Use of a DAD to join browser to database
htp.prn to generate HTML to your browser
Outputing database information to the browser via a DAD (obviously I'm SELECTing from DUAL you can use any table)

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now