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

x
?
Solved

CGI + databases + java

Posted on 1998-11-10
1
Medium Priority
?
240 Views
Last Modified: 2013-12-25
I'am making a programa in Java (applets) Client-Server.
The users access the systems with their browsers.
First they call an HTML initial page then
I have another pages wich have a Menu with options wich access
to the DataBases.
One option in the program is List the elements of a table.
What I want is list the elements of the table and Display them
in a HTML Table,
Somebody told me that this is possible that it is possible to
write server-side java (SERVLETS) or with CGI
JDBC offers possibilities to access databases.
but I really don't know how to do it.
Can Anybody give me THE CODE wich I have to write to do this?

Extra Information:

What I need is that the server send me a HTML page
having a table with the result of the SQL question.
The final objetive of that table is that the user
can send it to the Printer.
 I need to send this result to the
Printer so the easy way for me to do this is that the
server send me the results in a HTML page.
PD: I don´t know nothing of CGI so please be as clear as possible
0
Comment
Question by:Pampa
1 Comment
 
LVL 5

Accepted Solution

by:
aioudine earned 360 total points
ID: 1829525
You may acces database by using two method:

1) Applet on client workstation worked as RMI client
Java apllication (not servlet) worked in as RMI server
Applet send request to RMI server, RMI server access database using JDBC and return
result to RMI applet

see http://javaboutique.internet.com/article_Bi-Directional_RMI.html
for more info about RMI

2) On clent side you use just a <FORM> which send CGI request to server
On server you run SERVLET, which access database using JDBC or thin database driver
result returnes to client as HTML page

IMHO, servlet is better solution, becouse you may access DB from any browser,
without java on client side
--------
How to do this?
First you should learn what is servelet and how they work
read  "Goodbuy CGI, Say Hello to servlet"
thttp://www.webreview.com/97/10/10/feature/
and see links at bootom

Second downoad JSDK (java servlet developers kit)
JSDK available for downloading from http://www.javasoft.com 
(Click on product&API then go to "Servlet developers kit")


Third Install Servlet support for youre web server
many webservers embed support for Servlet (Like Netscape, servers, Tengah Weblogic,
SUN JavaWebserver, O'reilly WebSite Pro, NewAtlanta's ServletExec)
JSDK also included support for IIS and Apache

If youre servler not listed or you wish to use more robust solution
look for JRUN, product available from Live Software at http://www.jrun.com/
(Free lite version available for free)

for testing purpose JSDK also included srun - small program whitch allow to run and test servlet without webserver (Say on Win95 computer)
--------
As far as you are newbie I recommend you download JSDK from sun
install it on Win95 mashine and play with it



Articles "Introduction to Database Programming with Servlets" available from ServletCentral at
http://www.servletcentral.com/1998-10/colton.dchtml
(Source code included)


Additional information:
1) Servlet training availble at http://www.nova-labs.com/
2) Weblogic Tengah (servlet application server with database support):  http://www.weblogic.com
3) Javasoft home: http://www.javasoft.com
4) ServletCentral (Articles, resourses, review etc): http://www.servletcentral.com
5) ServletSource(Tips. tutorials etc): http://www.servletsource.com/
6) Article "Java DataBase Connectivity" with examples :  http://www.berger.com/jdbcpres.html
7) Introduction to JDBC programming at http://www.suite101.com/articles/article.cfm/1956
8) "Java meet CGI"  at http://www.webdeveloper.com/categories/java/java_meets_cgi.html
9)  "Comparison of JDBC and Java to HTML/CGI"
http://www.cariboulake.com/techinfo/java_html.html
10) "Java Apache Project" http://jserv.apache.org/
11) Disccusion transcript from JAvaOne
"Programming the Java Servlet API"
http://sunsite.compapp.dcu.ie/IJUG/javaone/transcripts/program.html






0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month18 days, 2 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question