import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;public class lishu extends JFrame
{    JLabel l=new JLabel();
JLabel l1;
JLabel l2,l3,l4,l5,l6;
JTextField t1,t2,t3,t4,t5;
JButton b1,b2; public lishu()
{setSize(300,265);
setLayout(null);
l1=new JLabel();
l1.setText("Êýѧ");
l1.setBorder(BorderFactory.createEtchedBorder());
l1.setBounds(new Rectangle(30,40,70,20));
add(l1,null);
t1=new JTextField();
t1.setBounds(new Rectangle(120,40,70,20));
add(t1);
l2=new JLabel();
l2.setText("Ó¢Óï");
l2.setBorder(BorderFactory.createEtchedBorder());
l2.setBounds(new Rectangle(30,70,70,20));
add(l2,null);
t2=new JTextField();
t2.setBounds(new Rectangle(120,70,70,20));
add(t2,null);
l3=new JLabel();
l3.setText("ÓïÎÄ");
l3.setBorder(BorderFactory.createEtchedBorder());
l3.setBounds(new Rectangle(30,100,70,20));
add(l3,null);
t3=new JTextField();
t3.setBounds(new Rectangle(120,100,70,20));
add(t3,null);
l4=new JLabel("ÎïÀí");
l4.setBorder(BorderFactory.createEtchedBorder());
l4.setBounds(new Rectangle(30,130,70,20));
add(l4,null);
t4=new JTextField();
t4.setBounds(new Rectangle(120,130,70,20));
add(t4,null);
l5=new JLabel();
l5.setText("»¯Ñ§");
l5.setBorder(BorderFactory.createEtchedBorder());
l5.setBounds(new Rectangle(30,160,70,20));
add(l5,null);
t5=new JTextField();
t5.setBounds(new Rectangle(120,160,70,20));
add(t5,null);
b1=new JButton("Y");
b1.setBounds(new Rectangle(60,190,50,30));
add(b1,null);
b1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
button1(e);}});
b2=new JButton("N");
b2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
}
});
b2.setBounds(new Rectangle(120,190,50,30));
add(b2,null);
l.setText("·´À¡ÐÅÏ¢");
l.setBounds(new Rectangle(175,190,70,30));
add(l,null);
    setVisible(true);}
    public int shuxue()///////shuxu
    {
     return Integer.parseInt(t1.getText().trim());//////·µ»ØÊýѧµÄ³É¼¨
     }
     public int english()/////english
     {
     return Integer.parseInt(t2.getText().trim());//////·µ»ØÓ¢ÓïµÄ³É¼¨
     }
     public int yuwen()
     {
     return Integer.parseInt(t3.getText().trim());////·µ»ØÓïÎĵijɼ¨
     }
     public int wuli()
     {
     return Integer.parseInt(t4.getText().trim());////·µ»ØÎïÀíµÄ³É¼¨
     }
     public int huaxue()/////·µ»Ø»¯Ñ§µÄ³É¼¨
     {
     return Integer.parseInt(t5.getText().trim());
     }
     public void button1(ActionEvent e)////////µ¥»÷°´Å¦·¢Éúʼþ£¨Á¬½ÓÊý¾Ý¿â£©
     {
    
    
     try
     {
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     }
     catch(ClassNotFoundException xyz)
     { }
     try
     {//Connection con;
     //Statement sql;
     // ResultSet rs;
     int shuxu=shuxue();int english=english();
     int yuwen=yuwen();int wuli=wuli();
     int huaxue=huaxue();
     //int shuxuid=1;int englishid=2;
     //int yuwenid=3;int wuliid=4;int huaxueid=5;
     //String shuxuname="Êýѧ";String englishname="Ó¢Óï";
     // String yuwenname="ÓïÎÄ" ;String wuliname="ÎïÀí";
     // String huaxuename="»¯Ñ§";
     Connection con=DriverManager.getConnection("jdbc:odbc:xiong","","");
     Statement sql=con.createStatement();
String stmt="INSERT INTO bin.xls VALUES ("+shuxu+","+english+","+yuwen+","+wuli+","+huaxue+")";
sql.executeUpdate(stmt);///////////ʼþ²Ù×÷ °Ñ½á¹û²å½øbinÊý¾Ý¿â}
catch(Exception www)
{}l.setText("¿ÉÒÔ´ó¸ç");
     }
public static void main(String[] args)
{
new lishu();
}}////////////end /////////////
/////////////////问题事我怎么把我输入的数据放不进数据库中啊,但是我建立的数据库和数据源
//多次检测都是成功的