<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%
//system.pub.oraclesql myDao = new system.pub.oraclesql();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:test1";
Connection con = DriverManager.getConnection(url, "", "");
String query = "select * from Sheet2";
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery(query);
out.println("哈哈哈哈");
while(rs.next()){
int id = rs.getInt("id");
String type = rs.getString("type");
String guige = rs.getString("guige");
String computer_product_no = rs.getString("computer_product_no");
String vga_product_no = rs.getString("vga_product_no");
String buying_date = "to_date('2004-10-01 00:00:00','yyyy-mm-dd HH24:MI:SS')";
String computer_name = "一机房台式机"+id;
String vga_name = "一机房显示器"+id;
system.pub.oraclesql myDao = new system.pub.oraclesql();
String insert = "insert into product(id,product_name,producer,type,count,price,buying_date,category,product_no,fixedAssets_no,teacher_id,location_id,KIND) values(product_sequence.nextval,'"+computer_name+"','联想集团','开 天M4600',1,'',"+buying_date+",0,'"+computer_product_no+"','',42,1,2)";
out.println(insert+"<br>");
myDao.execUpdate(insert);
insert = "insert into product(id,product_name,producer,type,count,price,buying_date,category,product_no,fixedAssets_no,teacher_id,location_id,KIND) values(product_sequence.nextval,'"+vga_name+"','联想集团','开 天M4600',1,'',"+buying_date+",0,'"+vga_product_no+"','',42,1,1)";
//insertStr = new String(insert.getBytes("ISO8859_1"),"gb2312");
myDao.execUpdate(insert);
myDao.CloseConn();
}
}
catch(Exception e){
System.out.println(e);
}
%>