1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
try {
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection("jdbc:postgresql://192.168.0.200:5432/moteur",
"resina", "da");
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
conn.commit() ;
//stmt.executeUpdate(" CREATE TABLE Agent( Agt_Code real PRIMARY KEY ,Agt_Nom_Pren varchar(40) )");
//stmt.executeUpdate("CREATE TABLE Agence( Ag_Code real PRIMARY KEY, Ag_Nom varchar(10) )");
conn.commit;
stmt.executeUpdate("CREATE TABLE sinistre(Sin_ref real PRIMARY KEY , Sin_Type varchar(15))");
conn.commit;
//stmt.executeUpdate("CREATE TABLE Peut avoir(Dte date)");
//conn.commit() ;
//stmt.executeUpdate("CREATE TABLE Assuré( As_Num_id real, As_Nom varchar(10), As_Pren varchar(30), As_dat_Nais date, As_Lieu_Nais varchar, As_prof varchar(15), As_Adr varchar(20), As_Tel real(8), as_Natio varchar(12)) )");
//conn.commit() ;
//stmt.executeUpdate("CREATE TABLE Cotise( Cot_Ref real, dat date, Cot_Mtt money) )" );
//stmt.executeUpdate("CREATE TABLE Contractant( Ctr_Nom_Pren varchar(40), Ctr_RaisonSle varchar(15), Ctr_Prof varchar(15), Ctr_Adr varchar(20), Ctr_Tel real) )");
//stmt.executeUpdate("CREATE TABLE Reclamation( Rcl_Ref real, Rcl_Nat varchar(12), Rcl_Lib varchar(10)) )");
//stmt.executeUpdate("CREATE TABLE Contrat( Ctrat_Num_Po real, Ctrat_Dte_Ef date, Ctrat_Type varchar(10)) )");
//stmt.executeUpdate("CREATE TABLE Contracter( Ctr_Nom_Pren varchar(40), Ctrat_Num_Po real, Ctrat_Dur_P real, Ctrat_Dte_Ech date) )");
//stmt.executeUpdate("CREATE TABLE Mode règlement( Rgl_Mod_P varchar(10), rgl_Frc_Prim) varchar(10) )");
//stmt.executeUpdate("CREATE TABLE Rachat( Rach_Ref real, Rach_Motif varchar(15)) )");
//stmt.executeUpdate("CREATE TABLE Banque( Banq_Code varchar(4), Banq_Nom varchar(5)) )");
//stmt.executeUpdate("CREATE TABLE Demander( Dat_Depot date, Delai_Remb date, Rd_Vous date) )");
}
catch (ClassNotFoundException ex){
System.out.println("exception:"+ex.getMessage());
ex.printStackTrace();
} |
Partager