Skip to Content
0
Former Member
Dec 20, 2005 at 05:57 AM

ApplicationServiceContext

31 Views

Hi,

i m customizing my application using classes from WEB AS.

I want to create a "servicecontext" from ApplicationServiceContext and want to paas it to the start() of ApplicationServiceFrame interface which i m implementing.

can any one help me.I m stuck with it for a very long time.

Follwoing is class that i have created.

package com.sap.engine.services.dbpool.deploy;

import java.rmi.RemoteException;

import java.util.Properties;

import com.sap.engine.frame.ApplicationFrameAdaptor;

import com.sap.engine.frame.ApplicationServiceContext;

import com.sap.engine.frame.ApplicationServiceFrame;

import com.sap.engine.frame.ServiceException;

import com.sap.engine.frame.ServiceRuntimeException;

import com.sap.engine.services.deploy.DeployService;

import com.sap.engine.services.monitor.server.MonitorServerFrame;

import com.sap.engine.frame.ApplicationFrameAdaptor;

import com.sap.engine.services.dbpool.PoolFrame;

/**

  • @author M1002023

*

  • To change the template for this generated type comment go to

  • Window>Preferences>Java>Code Generation>Code and Comments

*/

public class CreateDS implements ApplicationServiceFrame{

public static void main(String[] args) throws RemoteException

{

ApplicationServiceContext serviceContext;

CreateDS ds= new CreateDS();

try

{

ds.start(????<<serviceContext>>????);

}

catch(ServiceException ex)

{

}

}

public void start(ApplicationServiceContext serviceContext)

throws ServiceException

{

String applicationName="sap.com";

final com.sap.engine.services.dbpool.deploy.JDBCDescriptor sysDSDescr=new JDBCDescriptor();

int logDebug = 100;

String APP_NAME = "DBInitProcess";

String ROOT_CFG_NAME = "dbpool";

String DRV_HT_NAME = "drv";

String DBINIT_HT_NAME = "dbInit";

sysDSDescr.setDataSourceName("saurabh");

sysDSDescr.setDriverName("mysql");

sysDSDescr.setDriverClassName("org.gjt.mm.mysqlDriver");

sysDSDescr.setURL("jdbc:mysql://127.0.0.1/wise");

sysDSDescr.setPassword("");

sysDSDescr.setUsername("root");

sysDSDescr.setSQLEngine("Vendor SQL");

System.out.println(sysDSDescr.getDataSourceName());

System.out.println(sysDSDescr.getDriverClassName());

System.out.println(sysDSDescr.getDriverName());

System.out.println(sysDSDescr.getURL());

System.out.println(sysDSDescr.getUsername());

try

{

DataSourceManagerImpl dsm= new DataSourceManagerImpl(serviceContext,sysDSDescr);

dsm.createDataSource(applicationName,sysDSDescr);

}

catch(RemoteException rex)

{

}

}

public void stop() {

}

}

Can some help pls

Regards

saurabh