Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. <%//Récupérationdelaconnexion
  2. try{
  3.             //configuration du driver
  4.             Class.forName("oracle.jdbc.driver.OracleDriver");
  5.             //CONNECTION AU SGBD
  6.             //URL du serveur de BD
  7.  
  8.             String url = "jdbc:oracle:thin:@iutdoua-oracle.univ-lyon1.fr:1521:orcl";
  9.             //connexion à l’URL en précisant l’utilisateur et
  10.             // le mot de passe d’accès à la BD
  11.  
  12.             Connection connection = DriverManager.getConnection(url,user,passwd);
  13.            
  14.             Statement statement = connection.createStatement();
  15.             ResultSet result  = statement.executeQuery("select * from cpoa_personne");
  16.             while(result.next())
  17.                 {
  18.                     texte+=(result.getInt(1)+" | "+result.getString("nompersonne")+" | "+result.getString("prenompersonne"));        
  19.                 }
  20.            
  21.                
  22.            
  23.         } catch(Exception e){
  24.             texte+=(e);
  25.         }
  26. %>
  27.     <%=texte%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement