Jump to content
Fórum Script Brasil

leonardosc

Membros
  • Posts

    2
  • Joined

  • Last visited

About leonardosc

leonardosc's Achievements

0

Reputation

  1. Você não definiu o método main. Tente assim... import java.awt.*; import java.awt.event.*; public class Party { public void buildInvite() { Frame f = new Frame(); Label l = new Label("Party at Tim´s"); Button b = new Button("You bet"); Button c = new Button("Shoot me"); Panel p = new Panel(); p.add(l); } public static void main(String[] args) { Party party = new Party(); party.buildInvite(); } }
  2. leonardosc

    resultado em TXT

    Class.forName( "org.postgresql.Driver" ); Connection cn = DriverManager.getConnection( "jdbc:postgresql://10.0.0.10:5432/teste", "postgres", "teste" ); cn.setAutoCommit( true ); Statement st = cn.createStatement(); ResultSet rs = st.executeQuery( "SELECT * from funcionarios order by funcionarios" ); BufferedWriter bw = new BufferedWriter(new FileWriter("arquivo.txt", true)); while( rs.next() ) { String cpf = rs.getString( "cpfatendente" ); bw.write(cpf + "\n"); out.println( "CPF = " + cpf ); } bw.close(); rs.close(); st.close(); cn.close();Tente assim...
×
×
  • Create New...