贴上源代码:
private static String  Connction() throws Exception
 {
   Collection col = null;
   String driver =
       "org.apache.xindice.client.xmldb.DatabaseImpl";
   Class c = Class.forName(driver);
   Database database =(Database)c.newInstance();
   DatabaseManager.registerDatabase(database);
   col = DatabaseManager.getCollection("xmldb:xindice:///db/zkj/");
//与xindice数据库相连接
   jTextArea1.append( "successful\n");
   String[] doccount = null;
   String[] docpath = null;
   doccount = col.listResources();
//得到zkj下的所有的xml文件,并且把文件名放到doccount中
   return docpath;
}