on 2008 Jul 03 11:29 AM
Hi Friends,
I created Web Module Project in NWDS with JSP and Java class in side. I am using web.xml file also.
I struck at accessing MAXDB. could you provide provide steps to access database table from java class.
Regards,
Lakshmi Prasad.
Hi Lakshmi
you Can enable that table as an webservice from R/3 and use that webservice as that you can use it as a web enabled service in NWDS and you can fetch data from MaxDB.
regards,
Sharma Kvbk.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi Prasad,
When you deploy the EAR with the webmodule, you need to have a file called "data-source-aliases.xml" with content as below, in your EARs META-INF folder
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data-source-aliases SYSTEM 'data-source-aliases.dtd'>
<data-source-aliases>
<aliases>
<data-source-name>${com.sap.datasource.default}</data-source-name>
<alias>TEST_DS</alias>
</aliases>
</data-source-aliases>
This will create a datasource for you with name TEST_DS.
In your java code, you can lookup this datasource using below given code and get the JDBC Connection:
initialContext = new InitialContext();
dataSource = (DataSource) initialContext.lookup("jdbc/TEST_DS");
connection = m_dataSource.getConnection();
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.