1 Reply Latest reply on May 20, 2005 3:49 AM by jay young

    JdbcCacheLoader Problem

    jay young Newbie

      jbosscache1.2.2


      import org.jboss.cache.PropertyConfigurator;
      import org.jboss.cache.TreeCache;
      import org.jboss.cache.loader.JDBCCacheLoader;

      public class CacheLoaderTest {

      public static void main(String[] args) throws Exception {

      TreeCache tree=new TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(tree, "META-INF/oodb-service.xml");


      JDBCCacheLoader cache_loader=new JDBCCacheLoader();
      cache_loader.setCache(tree);

      tree.startService();
      cache_loader.loadEntireState();
      tree.get("/1/1","name");
      }
      }


      META-INF/oodb-service.xml:


      true

      <attributename="CacheLoaderClass">
      org.jboss.cache.loader.JDBCCacheLoader


      false
      /
      false
      false

      cache.jdbc.table.name=stu
      cache.jdbc.table.create=true
      cache.jdbc.table.drop=false
      cache.jdbc.fqn.column=id
      cache.jdbc.fqn.type=varchar(30) cache.jdbc.node.column=name
      cache.jdbc.node.type=varchar(10) cache.jdbc.node.column=age
      cache.jdbc.node.type=int(3)
      cache.jdbc.parent.column=parent
      cache.jdbc.driver=org.gjt.mm.mysql.Driver
      cache.jdbc.url=jdbc:mysql://127.0.0.1:3306/student
      cache.jdbc.user=root
      cache.jdbc.password=admin

        • 1. Re: JdbcCacheLoader Problem
          jay young Newbie

          java.lang.IllegalStateException: Missing required property: cache.jdbc.password
          at org.jboss.cache.loader.JDBCCacheLoader.getRequiredProperty(JDBCCacheLoader.java:1207)
          at org.jboss.cache.loader.JDBCCacheLoader.setConfig(JDBCCacheLoader.java:115)
          at org.jboss.cache.TreeCache.createCacheLoader(TreeCache.java:1308)
          at org.jboss.cache.TreeCache.startService(TreeCache.java:1081)
          at CacheLoaderTest.main(CacheLoaderTest.java:35)