PreparedStatement pre = null
try {
pre = con.prepareStatement(sql)
for (int i = 0i <objects.lengthi++) {
pre.setObject(i + 1, objects[i])
}
pre.executeUpdate()
} catch (SQLException e) {
e.printStackTrace()
}
}
请问你是用jsp显示swing显示。jsp显示就会人性化一点用数据库用oracle。首先你要建立用户信息你才可以更好的查询
table tbStu的建立
create table STUINFO
(
STU_ID NUMBER not null,
STU_NUMBER VARCHAR2(8) not null,
STU_NAME VARCHAR2(20) not null,
STU_AGE NUMBER,
STU_SEX CHAR(2) default '男',
STU_CARD VARCHAR2(18) not null,
STU_JOINTIME DATE,
STU_ADDRESS VARCHAR2(200) default '地址不详'
)
//你可以插入你想要的数据
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (5, '005', '溺水的鱼', null, '女', '430101198203050928', to_date('04-12-2006', 'dd-mm-yyyy'), '长沙市六堆子')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (6, '006', '皮蛋超人', 26, '男', '430108198308041108', to_date('01-09-2006', 'dd-mm-yyyy'), '长沙市南门口')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (7, '007', '樱桃肉丸子', null, '女', '430103198904058801', to_date('06-12-2006', 'dd-mm-yyyy'), '长沙市五一广场')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (1, '001', '小李飞车', 21, '男', '430105198503058982', to_date('06-12-2006', 'dd-mm-yyyy'), '长沙市金盆岭')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (2, '002', '一了百了', 25, '男', '430208197903051263', to_date('05-01-2006', 'dd-mm-yyyy'), '长沙市望月湖')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (33, '008', '李寻欢', 36, '男', '430103198103052927', to_date('13-11-2010 10:12:56', 'dd-mm-yyyy hh24:mi:ss'), '地址不详')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (3, '003', '路过莫错过', 20, '男', '430103198103052928', to_date('06-11-2005', 'dd-mm-yyyy'), '浏阳市')
insert into STUINFO (STU_ID, STU_NUMBER, STU_NAME, STU_AGE, STU_SEX, STU_CARD, STU_JOINTIME, STU_ADDRESS)
values (4, '004', '过来瞧瞧', 22, '男', '430106198503052452', to_date('02-03-2007', 'dd-mm-yyyy'), '长沙市马王堆')
commit
至此数据库已经建立好了
接下来是写一个java beanjava daoservlet , jsp.
太多了。如果觉得可以。。你给个邮箱号码给我咯。我直接发给你咯
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)