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 44
|
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.sun.corba.se.pept.transport.Connection;
public class Main {
/**
* @param args
* @throws SQLException
* @throws ClassNotFoundException
*/
public static void main(String[] args) throws SQLException, ClassNotFoundException {
// TODO Auto-generated method stub
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url= "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/statistiques.mdb";
String user = "";
String pass = "";
Connection connection = (Connection) DriverManager.getConnection(url,user,pass);
//Statement insert=laconnection.createStatement();
//int result=insert.executeUpdate("insert into client values ('"+login1+"','"+motdepasse+"','"+nom+"','"+prenom+"','"+datedenaissance+"','"+adresse+"','"+codepostal+"','"+ville+"','"+pays+"')");
//Statement delete=laconnection.createStatement();
//int result=delete.executeUpdate("DELETE FROM client WHERE login='"+login+"';");
/*Statement select=((java.sql.Connection) connection).createStatement();
String query="Select adresseIP from Visiteur";
ResultSet result=select.executeQuery(query);
while(result.next()){
String login =result.getString(1);
System.out.println(login);
}*/
connection.close();
}
} |