on 07-29-2004 5:43 AM
Hi All
I need some documents or help on how to make a jdbc connection using IConnectorService framework. Can anybody help?
Warm Regards
Shubhadip
Hi Shubhadip,
However, I have forgot to inform you that the connection must be closed when there is no need for it, e.g. as in the former code the closing will be:
try {
myconnection.close();
}
catch (ResourceException e2) {
e2.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shubhadip,
I have some usefull code for you.
//This method is to perform the connection to the DataBase, where
// the Database name is myDatabase
public IConnection getConnect()
{
IConnection myconnection = null;
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
Object connectorservic = PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
IConnectorGatewayService cgService = (IConnectorGatewayService)connectorservic;
mylogger = request.getLogger();
ConnectionProperties cp = new ConnectionProperties(request.getLocale(), request.getUser());
try {
myconnection = cgService.getConnection("myDatabase", cp);
}
catch (Exception e)
{
mylogger.severe(e.getMessage());
}
return myconnection;
}
Kind Regards,
Al-Suwaiyel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
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.