Solved

CGI + databases + java

Posted on 1998-11-10
1
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
aioudine earned 120 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

732 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