create table table1 (id int not null , name varchar(20) not null);
create table table2 (id int not null, info varchar(20) not null);
Class.forName(“org.gjt.mm.mysql.Driver”);
Connection conn=DriverManager.getConnection(“jdbc:mydql://localhost:3306/test”,”root’,””);
Statement stmt=conn.createStatement();
ResultSet rs=stamt.executeQuery(“select * from table1”);
JdbcRowSet jrs=new JdbcRowSetImpl(rs);
JdbcRowSet jrs=new JdbcRowSetImpl();
jrs.setUrl(“jdbc:mydql://localhost:3306/test”);
jrs.setUsername(“root”);
jrs.setPassWord(“”);
jrs.setCommand(“select * from table1”);
jrs.execute();
新闻热点
疑难解答