adding dimensions using API

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • RE: adding dimensions using API

      To connect to your server use this:

      Source Code

      1. Connection palo = org.palo.api.ConnectionFactory.getInstance().newConnection("localhost", "1234", "user", "pass");

      Once you are connected you can use the following to add a database:

      Source Code

      1. Database db = palo.addDatabase("dbName");

      Then add dimension(s) to the database:

      Source Code

      1. Dimension dim = db.addDimension("dimName");

      And Element(s) to the dimension:

      Source Code

      1. dim.addElement("1. Element", Element.ELEMENTTYPE_NUMERIC);

      Now you need a cube to view that what you just created:

      Source Code

      1. Cube cube = db.addCube("cubeName", db.getDimensions());

      This will create a database "dbName" with the dimension "dimName" containing the element "1. Element". The cube will contain all dimensions you created (using db.getDimensions()).

      I use the Palo Eclipse Tool to view what i did and that works like a charm.
      You could integrate the javadoc into your IDE as well. that way you can check what each function does :)

      The post was edited 1 time, last by Aranian ().

    • UnsatisfiedLinkError

      Thanks for your kind help.

      I am finding a new problem now when I try to compile the java file I am getting the following error:
      Exception in thread "main" java.lang.UnsatisfiedLinkError: init0
      at com.tensegrity.palojava.Palo.init0(Native Method)
      at com.tensegrity.palojava.Palo.init(Palo.java:65)
      at com.tensegrity.palojava.Palo.newConnection(Palo.java:87)
      at org.palo.api.impl.ConnectionImpl.<init>(ConnectionImpl.java:50)
      at org.palo.api.impl.ConnectionFactoryImpl.newConnection(ConnectionFactoryImpl.java:24)

      I have kept the jar and the dlls and the .so files in same directory then also it gives me this error.

      Please help me to fix this problem.

      Thanks
    • RE: UnsatisfiedLinkError

      hi,

      this looks like you using the new palo server 1.5 beta.
      In this case you have to provide following vm argument with your command line:
      -Dcom.tensegrity.palo.http=true

      E.g.:
      java -Dcom.tensegrity.palo.http=true -classpath .;..\lib\jpalo.jar org.palo.api.demos.ListDatabase Demo

      If 1.5 gets stable the additional vm argument is not needed anymore, but right now we have the dilemma to support two server versions.

      Regards,

      arnd