on 03-17-2005 4:18 PM
Hello, I'm programing in Java using JCO to connect to SAP. Everything works fine when I introduce good data in the createClient method. The problem is that if I introduce a wrong user/password it do not connect but I get no error code so I don't know how can I show the scpecific error to the user.
Also if the server does not exists an exception happend, I capture the exception and I can show the message as is but, how can I know if the exception is because of the server Id or the server Ip or the client number?
Thanks
Hello,
JCO exceptions are thrown using the JCO.Exception class.
When you catch the exception object you can find out the key, group and detail message. Based on the group like
JCO_ERROR_LOGON_FAILURE or JCO_ERROR_COMMUNICATION etc. you can take subsequent actions. The text gives you more details.
try {
client = JCO.createClient ....
} catch (JCO.Exception ex) {
if ( ex.getGroup() == JCO.Exception.JCO_ERROR_COMMUNICATION ) {
take some action....
}
ex.getMessage( )
}
Octavian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.