View Full Version : About API

09-17-2003, 12:08 PM
I tried to write an example to use API. The code can pass compile. However, the example can not run.
code as follows:
import mondrian.olap.*;
import java.io.PrintWriter;
public class test{
public static void main( String args[] )
Connection connection = DriverManager.getConnection(
"Provider=mondrian;" +
"Jdbc=jdbc:odbc:MondrianFoodMart;" +
I type the command as follows:
"java -classpath mondrian.jar test"
the error is "Exception in thread "main" java.lang.NoClassDefFoundError: test"

09-17-2003, 02:17 PM
This is nothing to do with mondrian. You would have the same problem if you just tried to print 'hello world'.
You need to compile your program, then include the classes directory that you compiled it to in your classpath, e.g. '-classpath mondrian.jar;classes'.