hello, i'm new to maxdb and java, and try to get the
example from the manual running but with no luck.

the prog is taken from the documentation and compiles
ok, but when running the prog i get the following
error:

C:\>java -cp c:\maxdb\runtime\jar\sapdbc.jar
.\HelloSapDB.class
Exception in thread "main"
java.lang.NoClassDefFoundError: /\HelloSapDB/class

then jdbc driver is located in
c:\maxdb\runtime\jar\sapdbc.jar

the output of the 'set' command shows the default
classpath as:
CLASSPATH=C:\j2sdk1.4.2_03\jre\lib;.

Note that the program compiles ok with javac and
produces the HelloSapDB.class file.

the sourse is:

import java.sql.*;

public class HelloSapDB {
    public static void main (String [] args)
            throws ClassNotFoundException,
SQLException
    {
        String dbm_user = "TESTUSER";
        String password = "TEST";
        String database_server = "LOCALSERVER";
        String database_name = "TST";
 
                System.out.println ("running!!!");
        Class.forName
("com.sap.dbtech.jdbc.DriverSapDB");
        String url = "jdbc:sapdb://" + database_server
+ "/" + database_name;
        Connection connection =
DriverManager.getConnection (url, dbm_user, password);
        Statement stmt = connection.createStatement
();
        ResultSet resultSet = stmt.executeQuery
("SELECT 'hello world' FROM dual");
        resultSet.next ();
        String hello = resultSet.getString (1);
        System.out.println (hello);
        resultSet.close ();
        stmt.close ();
        connection.close ();
    }

}


i'm using Win2000 with latest stable maxdb version and
latest stable jdbc driver.

thank you in advance for your help

Regards

Matt Rogers

__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to