路人

导航

<2005年12月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

统计

常用链接

留言簿

随笔档案(39)

相册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜

today~~this~

//这个东西没有在机器上调试过,是我想想今天的操作二写出来的,只给我自己看,不要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);
}

}
}

posted on 2005-12-12 21:57 山岗 阅读(67) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。