import java.net.url;
import java.sql.*;
public class create {
public create() {
}
public static void main(string[] args){
string url = "jdbc:oracle:thin:@10.0.1.3:1521:sdcdb";
string query = "create table myfirst" + "(id int,name char(10))";
string sql="insert into myfirst values(1,liming)";
string sql1="insert into myfirst values(2,mm)";
string sql2="delete myfirst where id=2";
try
{
class.forname("oracle.jdbc.driver.oracledriver");
connection conn = drivermanager.getconnection(url, "test", "test");
statement stmt = conn.createstatement();
stmt.executeupdate(query);
stmt.executeupdate(sql);
stmt.executeupdate(sql1);
stmt.executeupdate(sql2);
system.out.println("create success!");
stmt.close();
conn.close();
}
catch(java.lang.classnotfoundexception e){
system.err.print(e.getmessage());
}
catch(sqlexception ex){
system.out.println("\n***sqlexception caught ***\n");
}
}
}