The CGI (Common Gateway Interface) defines a way for a web server to interact with external content-generating programs, which are often referred to as CGI programs or CGI scripts.
Within Tomcat, CGI support can be added when you are using Tomcat as your HTTP server and require CGI support.
Most of the time, this will look like: Secondly, your output needs to be in HTML, or some other format that a browser will be able to display.
If you want to access a My SQL database through CGI, C is a great option.
Apache will assume that every file in this directory is a CGI program, and will attempt to execute it, when that particular resource is requested by a client. In this way, administrators can tightly control who is allowed to use CGI programs.Sure, you can use other languages such as PHP or Perl, and they might be easy to use, but C has the advantage of being fast, powerful, and fully compiled, thereby hiding your original code.In this article, Jeff Cogswell shows you how you can write CGI programs in C to access a My SQL database.This enables you to customize, translate, and modify, ready-to-use CGI applications.By installing them in your server you will be in full control.