Problème de connexion JDBC Oracle 10g XE
Fermé
Mimi_Hiwatari
Messages postés
2
Date d'inscription
vendredi 25 avril 2008
Statut
Membre
Dernière intervention
27 septembre 2008
-
27 sept. 2008 à 16:33
KJD - 4 oct. 2012 à 07:31
KJD - 4 oct. 2012 à 07:31
A voir également:
- Jdbc:oracle:thin:@localhost:1521:xe
- Localhost/phpmyadmin ✓ - Forum Linux / Unix
- Http://localhost/phpmyadmin/ ne marche pas .. ✓ - Forum PHP
- Localhost:8080 - Forum Webmastering
- Localhost 8080 - Forum Webmastering
- Localhost:8888 ✓ - Forum Réseaux sociaux
2 réponses
salut mimi
voici um bout de code qui marche sur oracle froo 10g avec les parametres par default
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@//127.0.0.1:1521/xe";
Connection conn = DriverManager.getConnection(url,"SYSTEM", "root");
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from help");
while (rset.next()) {
System.out.println (rset.getString(1));
}
ne pas oublier l'import du jar :
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
quelques liens cools:
http://www.oracle.com/technology/docs/tech/java/sqlj_jdbc/index.html
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/htdocs/templates.htm
A +
voici um bout de code qui marche sur oracle froo 10g avec les parametres par default
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@//127.0.0.1:1521/xe";
Connection conn = DriverManager.getConnection(url,"SYSTEM", "root");
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from help");
while (rset.next()) {
System.out.println (rset.getString(1));
}
ne pas oublier l'import du jar :
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
quelques liens cools:
http://www.oracle.com/technology/docs/tech/java/sqlj_jdbc/index.html
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/htdocs/templates.htm
A +
15 avril 2010 à 18:35
avec le jar ca marche nikel, merci stereobroo
16 mai 2011 à 02:22
22 mai 2011 à 21:38
j'ai utilisé le meme code mais ça ne marche pas pour moi !!
l'erreur est : oracle.jdbc.driver.T4CStatement cannot be cast to java.beans.Statement
ma base est Oracle 10g et le jar est ojdbc14.jar
où le problème?