This web log explains you how to deploy a new custom data source in SAP NetWeaver CE 7.1 to enable an application to get access to an external database other than the system databse of the SAP NW CE Application Server.
For an application to access an external database we have to deploy a data source for that database.But to deploy a datasource , we need to deploy the relavant JDBC driver for that data base.
The process of enabling your application to get acces to an external database requires the following steps:
The known ways to perform the above steps are:
The rest of this blog will guide you to establish a connection with an external database(eg: MYSQL) using the Web based SAP NW Administrative tool.
SAP NW Administrative tool:
!../../../../weblogs/images/251842966/image5.JPG|height=368|alt=image|align=middle|width=518|src=../../../../weblogs/images/251842966/image5.JPG|border=0!
Specify the name of the application that needs to be associated to the JDBC DataSource in the Application Name field. The system uses this name for the configuration that holds the JDBC DataSource.Select the SQL type support from the SQL Engine dropdown list box.
In the context of the SAP NetWeaver Application Server Java, you can use Open SQL, Native SQL or Vendor SQL as the SQL engine types in your Data Source definition.
But ,if you want to connect your application to existing tables in an external database, then you should consider using a custom DataSource with Native SQL or Vendor SQL access type. Open SQL is not an option in this case, since it only works using the System DataSource and connecting to the system database schema.So choose Vendor SQL From the SQL Engine type drop down list.
Select the transaction isolation level from the Isolation Level dropdown list box.
Select the JDBC type support from the JDBC Version dropdown list box. Depending on the JDBC version you choose, you have to enter the following additional information:
You can define Datasource alias(es)(eg:MYSQLDS_DS1_ALIAS1) for your datasource with JDBC Data Sources Aliases tab.A Data Source alias is a logical name mapped to the name of a real Data Source available in the system. You use the Data Source alias in your application code to connect to the underlying Data Source.
Finally,select Save. The newly created DataSource appears in the list of JDBC Custom DataSources.Now you can use your DataSource alias in your application code to connect to the underlying Data Source.
ds = (DataSource) ctx.lookup("jdbc/MYSQLDB_DS1_ALIAS1");
If you want you can view your data source aliases in the naming tree of the JNDI Registry using the JNDI Browser.
To open JNDI Browser Choose Problem Management-->JNDI Browser in the NW Administrative tool.References:
[SAP Help Documentation for deploying a Data Source | http://help.sap.com/saphelp_nwce10/helpdata/en/45/07d2eeea3e0485e10000000a155369/content.htm]
[SAP Help Documentation for JNDI Browser | http://help.sap.com/saphelp_nwce10/helpdata/en/45/27b87fd3a96d95e10000000a114a6b/content.htm]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 524 | |
| 263 | |
| 238 | |
| 234 | |
| 167 | |
| 157 | |
| 152 |