@@ -0,0 +1,1051 @@
+/*%0D%0A * To change this license header, choose License Headers in Project Properties.%0D%0A * To change this template file, choose Tools %7C Templates%0D%0A * and open the template in the editor.%0D%0A */%0D%0A package br.senac.tads.pi3.agenda.agenda;%0D%0A %0D%0A import java.sql.Connection;%0D%0A import java.sql.DriverManager;%0D%0A import java.sql.SQLException;%0D%0A %0D%0A /**%0D%0A  * @author Mauricio Gustavo%0D%0A  * @author Leandro Rodrigues%0D%0A  */%0D%0A public class Conexao %7B%0D%0A %0D%0A     Connection conn = null;%0D%0A %0D%0A     public Connection obterConexao() throws SQLException, ClassNotFoundException %7B%0D%0A         // Passo 1: Registrar driver JDBC.%0D%0A         Class.forName(%22org.apache.derby.jdbc.ClientDataSource%22);%0D%0A %0D%0A         // Passo 2: Abrir a conex%C3%83%C2%A3o%0D%0A         conn = DriverManager.getConnection(%0D%0A                 %22jdbc:derby://localhost:1527/agendabd;SecurityMechanism=3%22,%0D%0A                 %22app%22, // usuario%0D%0A                 %22app%22); // senha%0D%0A         return conn;%0D%0A     %7D%0D%0A %0D%0A     public void fechaConexoes() throws SQLException %7B%0D%0A         conn.commit();%0D%0A         conn.close();%0D%0A     %7D%0D%0A %7D

teste commit conexao