import java.sql.*;
class game0501{
String url = "jdbc:derby:db;create=true";
String usr = "";
String pwd = "";
public static void main(String [] args) {
game0501 f=new game0501();
}
game0501(){
Connection dbx;
Statement stx;
ResultSet rsx;
int s,x1;
String x2;
s=0;
try {
dbx = DriverManager.getConnection(url, usr, pwd);
stx = dbx.createStatement();
rsx = stx.executeQuery("select * from zgoogle where company=50");
if (rsx != null) {
while (rsx.next()) {
s = rsx.getInt("keyword");
x1 = rsx.getInt("company");
x2=rsx.getString("date");
System.out.println(x1);
System.out.println(x2);
}
}
rsx.close();
stx.close();
dbx.close();
} catch (Exception ex) {ex.printStackTrace();}
}
}
最終更新:2011年03月29日 01:25