The following code should allow you to connect to a "Company" object and from there perform your tasks (DI - NOT UI).
import com.sap.smb.sbo.api.*;
public static void main(String[] args)
{
ICompany company;
IDocuments document;
SBOCOMUtil util = new SBOCOMUtil();
company = util.newCompany();
try
{
company.setServer( "sqlservername" );
company.setCompanyDB( "dbname" );
company.setUserName( "manager" );
company.setPassword( "manager" );
company.setLanguage(com.sap.smb.sbo.api.SBOCOMConstants.BoSuppLangs_ln_English);
company.setDbUserName("sa");
company.setDbPassword("pwd");
company.setUseTrusted( new Boolean(false) );
int result = company.connect();
System.out.println("Company: " + company.getCompanyName());
// analyze connection result
if ( result != 0 )
{
System.out.println("Connection error: " + result);
}
else
{
System.out.println("Connection success, company name: " + company.getCompanyName() );
}
}
catch(SBOCOMException ex)
{
System.out.println(ex.getStackTraceString());
}
finally
{
company.disconnect();
}
}
Also take a look at the following path; "C:\Program Files (x86)\SAP\SAP Business One DI API\JCO\LIB" where you can find the wrapper for DI API also "C:\Program Files (x86)\SAP\SAP Business One SDK\Help" there should be a JCO zip with more details regarding the JAVA Approach. Generally, documentation is very poor regarding Java. Your best approach would be either the B1i or the COM solutions.
Regards,
enshadowed_