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 42 43
| int tailleVectorD = DNum.size();
int tailleVectorS = s.size();
for(int i=0;i<tailleVectorD;i++)
{
for(int sites=0;(sites<tailleVectorS && !trouve);sites++)
{
[des calculs]
}
try
{
if(i==tailleVectorD-1)
i=i-1+1;
// Connect to the Database
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
// String url = "jdbc:odbc:Teenergy"; // if using ODBC Data Source name
String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=[chemin de ma base]";
String userid = "";
String password = "";
Class.forName( driver );
Connection connection = DriverManager.getConnection( url, userid, password );
// Read data from a table
String requete = "update D set [les modifs] WHERE Num = ?";
PreparedStatement pstmt = connection.prepareStatement(requete);
pstmt.setString([...]);
pstmt.setString([...]);
pstmt.execute();
pstmt.executeUpdate();
pstmt.close();
}
catch(Exception e)
{
System.out.println( e );
}
} |
Partager