//这个东西没有在机器上调试过,是我想想今天的操作二写出来的,只给我自己看,不要COPY~
create database lxstest;
use lxstest;
create table student
{
one int,
two int,
three String,
four String
};
insert into student values('','','','');
12345,123,,
123457,456,,
//test.java
public class test{
private int lxs;
private int ghw;
private int gxw;
publi static void main(String[] args)
{
try
{
ClassforName(jdbc.odbc.JdbcOdbcDriver);
//数据源
Connection conn=DriverManager.getConnection("jdbc.odbc.lxstest");
Statement stmt=conn.createStatement;
ResultSet rs=stmt.executeQuery("select * from student");
while(rs.next())
{
lxs=rs.getInt(1);
ghw=rs.getInt(2);
break;
}
if(lxs<100000)
{
gxw=lxs*1000+ghw;
}
//插入操作~
stmt.executeUpdate(" ' "+gxw+" ',null,null,null ");
stmt.close();
conn.close();
}catch(Exception e)
{
System.out.println(e);
}
}
}