
{filelink=7095}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class OracleConnexion
{
/*
* Cette Méthode crée une connexion à une base de données Oracle
*/
public static Connection getOracleConnection() throws Exception
{
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:Base de Données";
String username = "nom d'utilisateur";
String password = "mot de passe";
Class.forName(driver); // Facultatif
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}
}