Practica

Solo disponible en BuenasTareas
  • Páginas : 4 (934 palabras )
  • Descarga(s) : 0
  • Publicado : 4 de diciembre de 2011
Leer documento completo
Vista previa del texto
package desktopapplication1;
import java.sql.*;
import javax.swing.JOptionPane;
/**
*
* @author ALUMNO
*/
public class alumnos extends javax.swing.JFrame {
private Connection conn;private Statement sentencia;
private ResultSet res;

/** Creates new form alumnos */
public alumnos() {
initComponents();

try{Class.forName("org.gjt.mm.mysql.Driver");
conn=DriverManager.getConnection("jdbc:mysql://localhost/control_escolar","root","root");
sentencia=conn.createStatement();JOptionPane.showMessageDialog(this,"La conexion fue correcta");

}catch(Exception e){
JOptionPane.showMessageDialog(this,e.getMessage());
}
}

/** This method is calledfrom within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jButton1 = new javax.swing.JButton();jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = newjavax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jTextField6 = new javax.swing.JTextField();
jButton2 = newjavax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);...
tracking img