Using SAP JCO to connect SAP server to JAVA application

When connecting SAP server to JAVA applications using SAP JCO, it is recommended to use load balancing parameters instead of direct server connection parameters for better reliability and performance.

Recommended Connection Parameters

Instead of using JCO_AHOST and JCO_SYSNR for direct server connection, use the following load balancing parameters ?

  • JCO_R3NAME ? Use this with the system ID of the target host
  • JCO_MSHOST ? Use this with the message server host name or IP address
  • JCO_MSSERV ? Use this with the message server port number
  • JCO_GROUP ? Use this with the name of the logon group

Example Configuration

Below is an example of how to configure SAP JCO connection properties using the recommended parameters ?

Properties properties = new Properties();
properties.setProperty("jco.client.client", "100");
properties.setProperty("jco.client.user", "username");
properties.setProperty("jco.client.passwd", "password");
properties.setProperty("jco.client.lang", "EN");

// Recommended load balancing parameters
properties.setProperty("jco.client.r3name", "PRD");
properties.setProperty("jco.client.mshost", "sapserver.company.com");
properties.setProperty("jco.client.msserv", "3600");
properties.setProperty("jco.client.group", "PUBLIC");

This approach provides better load distribution and failover capabilities compared to connecting directly to a specific application server.

Benefits of Load Balancing Parameters

Using message server and logon group parameters offers several advantages ?

  • Load Distribution ? Automatically distributes connections across available application servers
  • High Availability ? Provides failover capability if one server becomes unavailable
  • Scalability ? Easily accommodates additional application servers without code changes

Conclusion

Using SAP JCO with load balancing parameters (JCO_R3NAME, JCO_MSHOST, JCO_MSSERV, JCO_GROUP) instead of direct server parameters ensures better performance, reliability, and scalability for your Java applications connecting to SAP systems.

Updated on: 2026-03-13T19:09:56+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements