Thread: Connecting website with SQL-database.....

Connecting website with SQL-database.....

From
"J.Post"
Date:
I've been looking on the internet for 2 hours for information how to connect
my SQL database to my website. I didn't find what I was looking for, this is
my problem............
I have got a form on my site, that can be filled in by visitors. I want the
results automatically being written in my sql database, does anybody know
how to do this???




Re: Connecting website with SQL-database.....

From
Lamar Owen
Date:
"J.Post" wrote:
> 
> I've been looking on the internet for 2 hours for information how to connect
> my SQL database to my website. I didn't find what I was looking for, this is
> my problem............
> I have got a form on my site, that can be filled in by visitors. I want the
> results automatically being written in my sql database, does anybody know
> how to do this???

For a very easy to use way of doing this, check out AOLserver -- while
it does replace your existing webserver, it is fast and easy to use for
PostgreSQL.

If you are stuck with another webserver, you can probably use PHP, which
is also easy to use, but not as scalable or fast as the AOLserver
solution.

And, you can always use a Perl CGI with either the Perl interface module
distributed with the PostgreSQL distribution, or you can use the DBI/DBD
modules, also from perl.

If you've not written CGI scripts before, expect to speed more than 2
hours getting it to work.  If you are comfortable with CGI scripts (or
other web scripting), it shouldn't take very long to get the information
you need from the PostgreSQL documentation and the PostgreSQL
applications listing -- which I can't seem to locate at the moment. 
There is a users gallery on www.pgsql.com, but that's not the listing I
remember....

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


Re: Connecting website with SQL-database.....

From
Margarita Barvinok
Date:
On Mon, 17 Apr 2000, J.Post wrote:

> I've been looking on the internet for 2 hours for information how to connect
> my SQL database to my website. I didn't find what I was looking for, this is
> my problem............
> I have got a form on my site, that can be filled in by visitors. I want the
> results automatically being written in my sql database, does anybody know
> how to do this???
> 
> 
> 

I've wrote C programs (CGI).
I use embedded SQL for interface with database and POST method to get
information from web.
There are many free CGI scripts (C & Perl) on this website:
http://cgi.resourceindex.com/Programs_and_Scripts/
I can share my programs but this is my first experience with CGI/Web/SQL,
so programs are not elegant.
-Rita

--------------------------------------------------------
Margarita Barvinok                University of Michigan
System Administrator II           Department of Biology
brita@umich.edu
---------------------------------------------------------





Re: [GENERAL] Connecting website with SQL-database.....

From
"Manuel Lemos"
Date:
Hello J.Post,

On 17-Apr-00 12:26:41, you wrote:

>I've been looking on the internet for 2 hours for information how to connect
>my SQL database to my website. I didn't find what I was looking for, this is
>my problem............
>I have got a form on my site, that can be filled in by visitors. I want the
>results automatically being written in my sql database, does anybody know
>how to do this???

Whatever platform you use, PHP is the solution for your problem.  It is one
of the most powerful Web programming languages that is able to interface
natively with dozens of types databases including PostgreSQL. The good part
is that it is not tied to any Web server and it is Open Source.

http://www.php.net/

If you want to use a DBMS independent interface with database try Metabase
for PHP.  Metabase not only provides database independence in the access
but also in the installation of your database schemas (tables, fields,
indexes, sequences).

With a Metabase schema description language defined in a custom XML format,
you are able to install your schemas portably without having to wonder
exactly how.

The neat part is that if you want later to change your database schema by
adding/removing/changing/renaming tables/fields/indexes/sequences, all you
need to do is to make the changes in your database schema description file.

Then you only need to ask Metabase to upgrade it and it will issue the
necessary SQL commands to alter your database accordingly without affecting
any data that was stored after the database was installed for the first
time or upgraded for the last time.

Here you may find all the source code for Metabase with all the classes,
for the schema parser, database manager, driver classes for different DBMS
including PostgreSQL, example schemas and installation scripts, user manual
and tutorial documents.

http://phpclasses.UpperDesign.com/browse.html/package/20


Enjoy,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


Re: Connecting website with SQL-database.....

From
Joe Shevland
Date:
As another alternative, Java Server Pages (http://www.javasoft.com/jsp) are
great if you're into Java as you can embed the required (JDBC) code directly
into your HTML (like ASP's but way way better IMHO) or alternatively package the
logic into JavaBeans (or components) that can be called from your webpages.

If you're ultra keen I can even post you some JSP's that demonstrate this...

Regards,
Joe

Margarita Barvinok wrote:
> 
> On Mon, 17 Apr 2000, J.Post wrote:
> 
> > I've been looking on the internet for 2 hours for information how to connect
> > my SQL database to my website. I didn't find what I was looking for, this is
> > my problem............
> > I have got a form on my site, that can be filled in by visitors. I want the
> > results automatically being written in my sql database, does anybody know
> > how to do this???
> >
> >
> >
> 
> I've wrote C programs (CGI).
> I use embedded SQL for interface with database and POST method to get
> information from web.
> 
> There are many free CGI scripts (C & Perl) on this website:
> http://cgi.resourceindex.com/Programs_and_Scripts/
> 
> I can share my programs but this is my first experience with CGI/Web/SQL,
> so programs are not elegant.
> 
> -Rita
> 
> --------------------------------------------------------
> Margarita Barvinok                University of Michigan
> System Administrator II           Department of Biology
> brita@umich.edu
> ---------------------------------------------------------

-- 
Joe Shevland
Principal Consultant
KPI Logistics Pty Ltd
http://www.kpi.com.au
mailto:shevlandj@kpi.com.au


Re: [GENERAL] Connecting website with SQL-database.....

From
Titus Brown
Date:
-> On 17-Apr-00 12:26:41, you wrote:
->
-> >I've been looking on the internet for 2 hours for information how to connect
-> >my SQL database to my website. I didn't find what I was looking for, this is
-> >my problem............
-> >I have got a form on my site, that can be filled in by visitors. I want the
-> >results automatically being written in my sql database, does anybody know
-> >how to do this???
->
-> Whatever platform you use, PHP is the solution for your problem.  It is one
-> of the most powerful Web programming languages that is able to interface
-> natively with dozens of types databases including PostgreSQL. The good part
-> is that it is not tied to any Web server and it is Open Source.
->
-> http://www.php.net/

[ munch ]

For a good discussion of some of the alternatives (centered around but
not limited to AOLserver) you can visit photo.net/wtr/, the Web/db
bulletin board.

Not that I recommend anything in particular for your specific situation,
but it's always a good idea to get an idea of what's out there.

cheers,
--titus

psql & java

From
Frank Bax
Date:
I want to write a Java applet that retrieves/updates data in a psql
database.  I am running Apache and psql on a single OpenBSD server.  I
currently use PHP for dynamic pages; which has been fine up to now for
presenting data, but I can see the day coming where some processing at the
client side would be useful; so I want to take a closer look at java.  I
have been told by someone who knows little more than I do, that I need
servlets to get at my data with java applets.  When I go to the apache
site, I see references to Jakarta, Tomcat, Java-Apache, JSERV and JSSI.
But I couldn't find summaries that tell what these things are.  Can someone
tell me exactly which of the above components (and more?) I need to install
to make this work?  How do they fit together?  Do I also need JDBC?  Does
JDBC require ODBC?

Frank


Re: psql & java

From
Peter Mount
Date:
On Tue, 18 Apr 2000, Frank Bax wrote:

> I want to write a Java applet that retrieves/updates data in a psql
> database.  I am running Apache and psql on a single OpenBSD server.  I
> currently use PHP for dynamic pages; which has been fine up to now for
> presenting data, but I can see the day coming where some processing at the
> client side would be useful; so I want to take a closer look at java.  I
> have been told by someone who knows little more than I do, that I need
> servlets to get at my data with java applets.  When I go to the apache
> site, I see references to Jakarta, Tomcat, Java-Apache, JSERV and JSSI.

Ok, I've not played with servlets (had no need) but here goes (and
someone correct me if I'm wrong):

Java-Apache is the name of the project to integrate Java with Apache.

JSERV is a web server that embeds java into web pages which is processed
on the server. This is not JavaScript, but similar to PHP or ASP.

Not sure what JSSI is. I have heared of Jakarta & Tomcat, but thats all.

> But I couldn't find summaries that tell what these things are.  Can someone
> tell me exactly which of the above components (and more?) I need to install
> to make this work?  How do they fit together?

> Do I also need JDBC?

To access postgres from Java, you will need JDBC.

> Does JDBC require ODBC?

No. There are four types of JDBC driver, and ours is Type 4, which means
its written in pure java, and will run anywhere.

Peter

--      Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf



Re: psql & java

From
Guillaume Rousse
Date:
Le mar, 18 avr 2000, Peter Mount a �crit :
> On Tue, 18 Apr 2000, Frank Bax wrote:
> 
> > I want to write a Java applet that retrieves/updates data in a psql
> > database.  I am running Apache and psql on a single OpenBSD server.  I
> > currently use PHP for dynamic pages; which has been fine up to now for
> > presenting data, but I can see the day coming where some processing at the
> > client side would be useful; so I want to take a closer look at java.  I
> > have been told by someone who knows little more than I do, that I need
> > servlets to get at my data with java applets.  When I go to the apache
> > site, I see references to Jakarta, Tomcat, Java-Apache, JSERV and JSSI.
> 
> Ok, I've not played with servlets (had no need) but here goes (and
> someone correct me if I'm wrong):
> 
> Java-Apache is the name of the project to integrate Java with Apache.
> 
> JSERV is a web server that embeds java into web pages which is processed
> on the server. This is not JavaScript, but similar to PHP or ASP.
No. JServ is a servlet engine for Apache. It doesn't support JSP alone, and
it's not compliant with last version of servlet API. Tomcat, a part of Jakarta
project, is its successor : it's both a servlet (2.2 compliant) engine and a
JSP (1.1)  engine.

> Not sure what JSSI is. I have heared of Jakarta & Tomcat, but thats all.
It's Java Server-Side Include, the java equivalent of traditionnal SSI.

> > But I couldn't find summaries that tell what these things are.  Can someone
> > tell me exactly which of the above components (and more?) I need to install
> > to make this work?  How do they fit together?
You'll need PostgreSQL for storing the data, JDBC driver to access them, Tomcat
to process your servlets and JSP pages, Apache eventually if you also have
plain HTML, as Tomcat is stand-alone capable. I don't know for JSSI, but for
accessing data, this already largely enough.


-- 
Guillaume Rousse
Iremia - Universit� de la R�union

Sleep doesn't exists. Just lack of cafeine.


Re: psql & java

From
Joe Shevland
Date:
The only thing I'd add to all of this is that applets can do your
client-side processing for you if you like... your applet needs
to open a URLConnection to a servlet on the webserver, and this
way you can communicate via SSL, plain ol' TCP/IP, object input/output
streams etc. But effectively the servlet you can think of like
a CGI application running on the server. JDBC can also take place
from the applet to the server, but there's issues between how IE's
VM and Netscape's VM instantiate JDBC driver's (IE does not, as
per usual, follow the standard).

Regards,
Joe

Guillaume Rousse wrote:
> 
> Le mar, 18 avr 2000, Peter Mount a écrit :
> > On Tue, 18 Apr 2000, Frank Bax wrote:
> >
> > > I want to write a Java applet that retrieves/updates data in a psql
> > > database.  I am running Apache and psql on a single OpenBSD server.  I
> > > currently use PHP for dynamic pages; which has been fine up to now for
> > > presenting data, but I can see the day coming where some processing at the
> > > client side would be useful; so I want to take a closer look at java.  I
> > > have been told by someone who knows little more than I do, that I need
> > > servlets to get at my data with java applets.  When I go to the apache
> > > site, I see references to Jakarta, Tomcat, Java-Apache, JSERV and JSSI.
> >
> > Ok, I've not played with servlets (had no need) but here goes (and
> > someone correct me if I'm wrong):
> >
> > Java-Apache is the name of the project to integrate Java with Apache.
> >
> > JSERV is a web server that embeds java into web pages which is processed
> > on the server. This is not JavaScript, but similar to PHP or ASP.
> No. JServ is a servlet engine for Apache. It doesn't support JSP alone, and
> it's not compliant with last version of servlet API. Tomcat, a part of Jakarta
> project, is its successor : it's both a servlet (2.2 compliant) engine and a
> JSP (1.1)  engine.
> 
> > Not sure what JSSI is. I have heared of Jakarta & Tomcat, but thats all.
> It's Java Server-Side Include, the java equivalent of traditionnal SSI.
> 
> > > But I couldn't find summaries that tell what these things are.  Can someone
> > > tell me exactly which of the above components (and more?) I need to install
> > > to make this work?  How do they fit together?
> You'll need PostgreSQL for storing the data, JDBC driver to access them, Tomcat
> to process your servlets and JSP pages, Apache eventually if you also have
> plain HTML, as Tomcat is stand-alone capable. I don't know for JSSI, but for
> accessing data, this already largely enough.
> 
> --
> Guillaume Rousse
> Iremia - Université de la Réunion
> 
> Sleep doesn't exists. Just lack of cafeine.

-- 
Joe Shevland
Principal Consultant
KPI Logistics Pty Ltd
http://www.kpi.com.au
mailto:shevlandj@kpi.com.au

"I'm not under the alkafluence of inkahol that some thinkle peep I am.
It's just the drunker I sit here the longer I get."