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--