Código PHP:
/*
* Coneccion.java
*
* Created on 24 de agosto de 2005, 20:59
*/
package facturacion;
import java.sql.*;
import javax.swing.*;
import javax.swing.event.*;
/**
*
* @author Administrador
*/
public class Coneccion extends javax.swing.JFrame {
/** Creates new form Coneccion */
public Coneccion() {
try
{
String sDBUrl = "jdbc:mysql://localhost/autos";
DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
Connection cn = DriverManager.getConnection(sDBUrl,"autos","autos");
Statement st = cn.createStatement();
cn.close();
st.close();
show();
} catch (SQLException e)
{
}
initComponents();
}
/** This method is called from 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jLayeredPane1 = new javax.swing.JLayeredPane();
jTable1 = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jTable1.setBounds(100, 50, 390, 170);
jLayeredPane1.add(jTable1, javax.swing.JLayeredPane.DEFAULT_LAYER);
getContentPane().add(jLayeredPane1, java.awt.BorderLayout.CENTER);
show();
}
// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new nuevo().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLayeredPane jLayeredPane1;
private javax.swing.JTable jTable1;
// End of variables declaration//GEN-END:variables
}