From robson@netalfa.com.br Wed Jul 14 20:22:24 1999 Received: from paris.netalfa.com.br ([200.210.212.12]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA06841 for ; Wed, 14 Jul 1999 16:22:24 -0400 (EDT) (envelope-from robson@netalfa.com.br) Received: from Designer2 ([200.210.212.30]) by paris.netalfa.com.br (8.9.2/8.9.2) with SMTP id RAA15514 for ; Wed, 14 Jul 1999 17:24:23 -0300 (EST) Message-ID: <000b01bece36$2d342320$1ed4d2c8@Designer2.netalfa.com.br> Reply-To: "Robson Martins" From: "Robson Martins" To: "pgsql-interfaces" Subject: I'm getting crazy...HELP ME! Date: Wed, 14 Jul 1999 17:19:28 -0300 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0007_01BECE1D.078235E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_0007_01BECE1D.078235E0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0008_01BECE1D.078235E0" ------=_NextPart_001_0008_01BECE1D.078235E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello all! I have a .java that i think it is right but it doesnt work, the problem = is that it cant connect to the database, the button connect is to = connect to the database, the button list is to list the value from field = name from table people from database on a textarea, the button Robson - = Test, is a button that i created only to test. To make this .java work you will need a database with a table people = with a field name with any values. I didnt make it works, if anybody have success please help me, and if = anybody have any .java like this that do the thing i wanna do, please = send me (without use swing). Well i think this is all.... HELP ME...... Hugs..Robson ( robson@netalfa.com.br ) ------=_NextPart_001_0008_01BECE1D.078235E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello all!
I have a .java that i think it is right but it = doesnt work,=20 the problem is that it cant connect to the database, the button connect = is to=20 connect to the database, the button list is to list the value from field = name=20 from table people from database on a textarea, the button Robson - Test, = is a=20 button that i created only to test.
To make this .java work you will need a database = with a table=20 people with a field name with any values.
I didnt make it works, if anybody have success = please help me,=20 and if anybody have any .java like this that do the thing i wanna do, = please=20 send me (without use swing).
Well i think this is all....
HELP ME......
Hugs..Robson ( robson@netalfa.com.br=20 )
------=_NextPart_001_0008_01BECE1D.078235E0-- ------=_NextPart_000_0007_01BECE1D.078235E0 Content-Type: text/html; name="robson.htm" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="robson.htm" ------=_NextPart_000_0007_01BECE1D.078235E0 Content-Type: application/octet-stream; name="robson.java" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="robson.java" import java.sql.*; import java.awt.*; import java.applet.*; import java.awt.event.*; import java.io.*; public class robson extends Applet { Button btnLis =3D new Button("List"); Button btnCon =3D new Button("Connect"); Button btnRob =3D new Button("Robson - Test"); TextArea saida =3D new TextArea("",15,59,TextArea.SCROLLBARS_BOTH); Statement st; Connection co; ResultSet rs; public void init() { setLayout(new FlowLayout()); btnLis.addActionListener(new btnLis_actionAdapter()); btnCon.addActionListener(new btnCon_actionAdapter()); btnRob.addActionListener(new btnRob_actionAdapter()); add(saida); add(btnCon); add(btnLis);=20 add(btnRob);=20 }=20 class btnCon_actionAdapter implements ActionListener { public void actionPerformed(ActionEvent e) { try { saida.append("Carregando Driver ...\n"); Class.forName ("postgresql.Driver");=20 saida.append("Driver Carregado ...\n"); saida.append("Conectando ao Banco de Dados ...\n"); co =3D = DriverManager.getConnection("jdbc:postgresql://host/db","user","pass"); //btnCon.setEnabled(false); } catch (Exception e1) { //saida.setText("Problema ao Conectar no Banco de Dados"+"\n"+"Erro: = "+e1.toString()+"\n"); saida.append("Problema ao Conectar no Banco de Dados"+"\n"+"Erro: = "+e1.toString()+"\n"); } } } class btnLis_actionAdapter implements ActionListener { public void actionPerformed(ActionEvent e) { try {=20 lista_rob(); }=20 catch (Exception e1) { saida.append(e1.toString()+"\n"); } } } class btnRob_actionAdapter implements ActionListener { public void actionPerformed(ActionEvent e) { try {=20 saida.append("Robson\n"); }=20 catch (Exception e1) { saida.append(e1.toString()+"\n"); } } } public void lista_rob() throws Exception { String nome;=20 st =3D co.createStatement();=20 rs =3D st.executeQuery("select name from people"); saida.setText(""); saida.append("Name \n"); while (rs.next()) {=20 nome =3D rs.getString("name"); saida.append(nome+"\n"); } } } ------=_NextPart_000_0007_01BECE1D.078235E0-- From petermount@it.maidstone.gov.uk Thu Jul 15 06:58:33 1999 Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.org (8.9.3/8.9.3) with ESMTP id CAA86809 for ; Thu, 15 Jul 1999 02:58:33 -0400 (EDT) (envelope-from petermount@it.maidstone.gov.uk) Received: from maidstonebc.demon.co.uk ([158.152.139.246] helo=gatekeeper.maidstone.gov.uk) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 114fTT-0000Sk-0B; Thu, 15 Jul 1999 06:58:32 +0000 Received: from exchange1.nt.maidstone.gov.uk (exchange1.nt.maidstone.gov.uk [172.16.0.150]) by gatekeeper.maidstone.gov.uk (8.8.4/8.8.4) with ESMTP id GAA10090; Thu, 15 Jul 1999 06:57:47 GMT Received: by exchange1.nt.maidstone.gov.uk with Internet Mail Service (5.5.1960.3) id <35ZPCY6S>; Thu, 15 Jul 1999 07:57:34 +0100 Message-ID: <1B3D5E532D18D311861A00600865478CA0AB@exchange1.nt.maidstone.gov.uk> From: Peter Mount To: "'Robson Martins'" , pgsql-interfaces Subject: RE: [INTERFACES] I'm getting crazy...HELP ME! Date: Thu, 15 Jul 1999 07:57:34 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id CAA86810       co = DriverManager.getConnection("jdbc:postgresql://host/db","user","pass"); This line will be your problem. Is the server you are loading the applet from called host? If not, the browser will block the driver from connecting.   ie: If I had an applet on my web site, and it downloaded from the url:       http://www.retep.org.uk/applet.html   Then the connection line should read something like:         co = DriverManager.getConnection("jdbc:postgresql://www.retep.org.uk/db","use r","pass");   IE: the host name must be identical. Even if your host has multiple dns entries.   PS: The above url's don't exist ;-) Peter -- Peter Mount Enterprise Support Maidstone Borough Council Any views stated are my own, and not those of Maidstone Borough Council. -----Original Message----- From: Robson Martins [mailto:robson@netalfa.com.br] Sent: 14 July 1999 21:19 To: pgsql-interfaces Subject: [INTERFACES] I'm getting crazy...HELP ME! Hello all! I have a .java that i think it is right but it doesnt work, the problem is that it cant connect to the database, the button connect is to connect to the database, the button list is to list the value from field name from table people from database on a textarea, the button Robson - Test, is a button that i created only to test. To make this .java work you will need a database with a table people with a field name with any values. I didnt make it works, if anybody have success please help me, and if anybody have any .java like this that do the thing i wanna do, please send me (without use swing). Well i think this is all.... HELP ME...... Hugs..Robson ( robson@netalfa.com.br ) From robson@netalfa.com.br Thu Jul 15 12:10:10 1999 Received: from paris.netalfa.com.br ([200.210.212.12]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA32727 for ; Thu, 15 Jul 1999 08:10:10 -0400 (EDT) (envelope-from robson@netalfa.com.br) Received: from Designer2 ([200.210.212.30]) by paris.netalfa.com.br (8.9.2/8.9.2) with SMTP id JAA17377 for ; Thu, 15 Jul 1999 09:12:30 -0300 (EST) Message-ID: <003c01beceba$9f15d680$1ed4d2c8@Designer2.netalfa.com.br> Reply-To: "Robson Martins" From: "Robson Martins" To: "pgsql-interfaces" Subject: Re: [INTERFACES] I'm getting crazy...HELP ME! Date: Thu, 15 Jul 1999 09:07:32 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 -----Mensagem original----- De: Peter Mount Para: 'Robson Martins' ; pgsql-interfaces Data: Quinta-feira, 15 de Julho de 1999 04:01 Assunto: RE: [INTERFACES] I'm getting crazy...HELP ME! Peter Mount......Thank You! You helped me a lot! The applet worked on the same computer where is the database. Thanks for your answer, thanks for help! Hugs... Robson Martins ( robson@netalfa.com.br )