I'm using WIN2k, jdk 1.3.1_04, tomcat 4.0.3, cocoon 2.0.2 and Xindice 1.0

and try to get a Database application to run. my code works fine under
JBuilder6,
but my applet always search the orb.properties file.

Java-Console-Error:
XML:DB Exception occured 1 A connection to the Database instance 'db' could
not be created.
Error: access denied (java.io.FilePermission C:\Dokumente und
Einstellungen\Administrator\Desktop\orb.properties read)

Did anyone know, why I need this orb.properties file?
Or is there a possibility to config cocoon for xindice?
here is the code I try to connect the xindice server:

public static void add() throws Exception {
      Collection col = null;
      try {
         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/addressbook");
         String save = createDoc.getDocument();
         String data = readFileFromDisk(save);
         XMLResource document = (XMLResource) col.createResource(null,
            "XMLResource");
         document.setContent(data);
         col.storeResource(document);
         System.out.println("Document " + save + " inserted as " +
            document.getId());
      }
      catch (XMLDBException e) {
         System.err.println("XML:DB Exception occured " + e.errorCode + " "
+
            e.getMessage());
      }
      finally {
         if (col != null) {
            col.close();
        }
      }
   }
   public static String readFileFromDisk(String fileName) throws Exception {
      File file = new File(fileName);
      FileInputStream insr = new FileInputStream(file);
      byte[] fileBuffer = new byte[(int)file.length()];
      insr.read(fileBuffer);
      insr.close();
      return new String(fileBuffer);
   }

thanks for help

Tobias



_______________________________________________
Gossip mailing list
[EMAIL PROTECTED]
http://jab.org/cgi-bin/mailman/listinfo/gossip

Reply via email to