Bonjour,
le programme que je débugue actuellement implémente un système pour lister les sources de données ODBC installées sur la machine de la manière suivant:
Les programmeurs ont utilisé un driver Servertec:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 try { Vector listenomsources= new Vector(); for(Enumeration listesources = OdbcManager.getUserDataSources();listesources.hasMoreElements();) { OdbcDataSource source = (OdbcDataSource)listesources.nextElement(); String nomsource = source.getName(); listenomsources.add(nomsource); nom.addItem(nomsource); } return listenomsources;
import stec.sfc.Win32.OdbcDataSource;
import stec.sfc.*;
import stec.sfc.Win32.OdbcManager;
import stec.sfc.Win32.Win32Exception;
Mais ça génère une exception:
Au vu de la première ligne, j'ai l'impression que le driver ne marche pas sous XP. Je suis allé sur le site de Servertec mais aucune mise à jour.
Code : 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
64
65
66
67 Servertec (R) Foundation Classes Version 1.3.3 09/04/2005 Open Source Release Copyright (C) 2001-2005 Servertec. All rights reserved. Exception occurred during event dispatching: java.lang.UnsatisfiedLinkError: no sfc_w2k in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at stec.sfc.Win32.sfc.init(Unknown Source) at stec.sfc.Win32.OdbcManager.<clinit>(Unknown Source) at gui.ConnexionDialog.RecupDataSources(ConnexionDialog.java:265) at gui.ConnexionDialog.actionPerformed(ConnexionDialog.java:221) at javax.swing.JComboBox.fireActionEvent(Unknown Source) at javax.swing.JComboBox.setSelectedItem(Unknown Source) at javax.swing.JComboBox.setSelectedIndex(Unknown Source) at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.Dialog$1.run(Unknown Source) at java.awt.Dialog$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Dialog.show(Unknown Source) at gui.ConnexionDialog.<init>(ConnexionDialog.java:183) at gui.GUIDiscretisation.actionPerformed(GUIDiscretisation.java:180) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
Ce qu'ils ont fait marche à priori sur Windows 2000. J'ai bien enregistré des sources de données ODBC sur mon poste sous XP SP2.
Il y a le driver jdbc.odbc mais je n'ai rien trouvé qui m'expliquerait simplement comment lister les sources odbc (je veux lister les sources de données, pas les manipuler).
Partager