Bonjour,
j'ai un souci et je ne comprends pas pourquoi j'ai cette erreur.
je m'explique : je travaille sur un grand projet qui n'a pas été fait pas moi, j'essaie de mettre en place une BDD HSQLDB au lieu de ORACLE pour avoir une BDD embarquée (c'est mon tuteur de stage qui m'a demandé de le faire)
il y a un fichier "parameter-eclipse.properties" dans lequel j'ai remplacé par ça (avant c'était sur oracle)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 appli.db.driver=org.hsqldb.jdbcDriver appli.db.url=jdbc:hsqldb:file:database appli.db.user=sa appli.db.pwd= appli.db.schema=
Code JAVA : Sélectionner tout - Visualiser dans une fenêtre à part
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 public class AutorisationTest { private Connection cn = null; @Before public void setUp() throws Exception { //super(); try { Class.forName("org.hsqldb.jdbcDriver"); cn = DriverManager.getConnection("jdbc:hsqldb:file:database;shutdown=true", "sa", ""); Statement statement = cn.createStatement(); statement.execute("SET DATABASE SQL SYNTAX ORA TRUE"); statement.close(); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } } @Test public void test() { try { BatchStarter batchStarter = new fr.xxx.xxxx.xxx.batch.BatchStarter(); String args[] = {"traitementautorisation"}; batchStarter.main(args); } catch (Exception e) { e.printStackTrace(); } //quand je test cette partie ça marche mais quand je test ce qu'il y a juste avant ça ne marche pas /*Statement statement; try { statement = cn.createStatement(); statement.executeUpdate("CREATE TABLE IF NOT EXISTS test (colonne1 INT, colonne2 INT)"); for(int i=0; i<= 10; i++) { statement.executeUpdate("insert into test values ('"+i+"', '"+i+"')"); } statement.close(); DatabaseManagerSwing manager = new DatabaseManagerSwing(); manager.main(); manager.connect(cn); manager.start(); //cn.close(); } catch (SQLException e) { }*/ } }
l'erreur que j'ai : org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: L'URL Oracle indiquée n'est pas valide
pourquoi il cherche oracle alors que j'ai mis HSQLDB ?
quelqu'un peut m'aider svp
Partager