on 01-08-2007 2:01 AM
public class JCOConnection {
private String connectionPool = "ElectcomsPool";
private JCO.Repository mRepository = null;
public JCOConnection(){
JCO.Pool pool = JCO.getClientPoolManager().getPool(connectionPool);
if (pool == null) {
System.out.println("createPool");
OrderedProperties logonProperties;
try {
// Configuration conf=new Configuration();
// JCO.addClientPool(connectionPool,5,conf.getClient().toString(),conf.getUser().toString(),conf.getPwd().toString(),null,conf.getHost().toString(),conf.getSysnr().toString());
String currentDir = System.getProperty("user.dir");
System.out.println(currentDir);
logonProperties = OrderedProperties.load("C:\tomcat\webapps\TESTING2\WEB-INF\logon.properties");
//JCO.addClientPool(connectionPool,5,OrderedProperties.load(fileIn));
JCO.addClientPool(connectionPool,5,logonProperties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.err.println("logon:" +e);
}
// JCO.addClientPool(connectionPool, 5, logOnInfo.getSapClient(), logOnInfo.getUserId(), logOnInfo.getPassword(), logOnInfo.getLanguage(), logOnInfo.getHostName(), logOnInfo.getSystemNo());
}
mRepository = new JCO.Repository("ElectcomsRepository", connectionPool);
System.out.println("mRepository " + mRepository);
}
In windows ENV
C:
tomcat
webapps
TESTING2
WEB-INF
logon.properties
In linux ENV
usually the tomcat will locatate in which path ?
pls advice
<u>linux</u>
PATH = ??
Hi,
You can do it much easier by placing the properties file in your WEB-INF\classes directory. The java classloader will find it automatically, no need to specify path.
Good luck,
Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.