Linux Journal: Using Java Servlets with Database Connectivity | Linux Today

Linux Journal: Using Java Servlets with Database Connectivity

Written By
Web Webster
Web Webster
Oct 18, 1999

“The Common Gateway Interface (CGI) has and continues to be the
most commonly used method for creating dynamic and responsive web
pages. The main problem with CGI (that stems from the Hyper-Text
Transfer Protocol) is that each new client request results in a new
instance of the CGI executable being forked by the HTTP daemon.
This can lead to considerable resource consumption on web hosting
machinery. Many solutions exist to address this problem, most
focusing on keeping the executable persistent between client
requests. This has the added benefit of holding open costly
resources like database and socket connections.”

“Java is one of the newest kids on the block, but as a C and C++
coder I really like some of the features of this language. Its
object model is nice, it is (relatively) portable, and the class
libraries available from both Sun and third parties are extensive.
Servlets, a rather fanciful name, is the Java answer to the CGI
problem. Servlets are Java classes, loaded and kept resident by
the HTTP daemon. When the servlet is loaded, it is initialized by a
method call; at that point, database connections can be established
and held between client requests.
In addition to this, there
are a number of useful classes which facilitate the more complex
server/browser interactions such as cookies. Unfortunately, the
Servlet classes from Sun are still in a fluid state and, therefore,
code written now may be broken by future releases. This is a fact
of programming life and since this is a small application, not much
harm is likely.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.