bonjour,
mon probleme:
_je fais une connection avec sun.jdbc.odbc.JdbcOdbcDriver
_je veux recuperer le nom des tables
_sur certaines bases j'obtiens bien le nom de toutes les tables alors qu'avec d'autres je n'ai aucun resultat pourtant les tables existent bien
voila le code que j'utlise
public String[] getNomTables()
{
ArrayList tbnames = new ArrayList();
String catalog = null;
DatabaseMetaData dbmeta = null;
try {
dbmeta = con.getMetaData();
} catch (SQLException e) {
e.printStackTrace();
}
String types[] ={"TABLES"};
ResultSet rs = null;
try {
rs =dbmeta.getTables(catalog, null,"%", types);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
while(rs.next()){
tbnames.add(rs.getString("TABLE_NAME"));
}
} catch (SQLException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
String tbnoms [] = new String [tbnames.size()];
for(int i = 0; i < tbnames.size(); i++){
tbnoms[i] = String.valueOf(tbnames.get(i));
}
return tbnoms;
}
j'espere que qqn aura une solution pour moi
@+
sirm0240