Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Jco SAP Connection Error. Please Help

Hello

I'm a newbie and I'm trying to connect to SAP with this simple application I took from SAP help but I got an error message. Below is the code. At the bottom is the error message I get. It seems like the public Connect1 is not a type or must be decleared first.I tried doing that but the problem still persist.Could any body show me how to get ride of this problem? Thank you all.

import com.sap.mw.jco.*;

public class JcoTest {

JCO.Client mConnection;

public Connect1() {

try{

mConnection = JCO.createClient("300",//SAP Cleint

"<Test>",//userid

"test2",//password

"EN",//language

"<sap6>",//host name

"00");// system number

mConnection.connect();

System.out.println(mConnection.getAttributes());

mConnection.disconnect();

}

catch (Exception ex){

ex.printStackTrace();

System.exit(1);

}

}

public static void main(String args[]) {

Connect1 app = new Connect1();

}

}

ERROR MESSAGE STARTS HERE:

java.lang.Error: Unresolved compilation problems:

Connect1 cannot be resolved or is not a type

Connect1 cannot be resolved or is not a type

at JcoTest.main(JcoTest.java:40)

Exception in thread "main"

Former Member
Not what you were looking for? View more on this topic or Ask a question