on 03-18-2005 6:13 AM
hi
i want to access data from MS SQL Server database thru a WebDynpro model application.
so i did install the microsoft jdbc driver and registed that in Visual Administrator.
now what type of model class should i create?
also
in normal java app we use to give all the conn parameters including ConnectionURL etc in the code itself will it differ in webdynpro (since we are creating a new alias in Visual Admin can we call the alias to get the connection? )
any code snippets will be helpful
Thanks in Advance
Jer
Hi Jer,
I can send you the project latest by tomorrow.
Because still i am working on that.
But currently it works for SAP DB. If you want for SQL Server you need to modify the code little bit.(DataType mappings)
I want to introduce Mapping file that will generate the Java types based on the DB (SQL Server, SAP DB etc)
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Please find the link below.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jer,
Yes.You can create a simple java application that will create simple bean containing Java classes for each(required) table in the SQL server and you can import that simpleBean.jar in webdynpro using the JavaBeanImporter.
I have created a simple java application for the same .If you want i share oit for you )
Regards,
Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jer,
You have to create a new datasource through visual admin and configure your uploaded driver class for this datasource. Now from your code you can access this datasource with its alias name.
For connecting to database you can create an EJB project and do the communication with database from that. For accessing the EJB project you can just refer the project from your WD project(w/o creating a model) or you can expose your ejb business methods as local web service and create a web service model out of it. Both are very much possible in NWDS.
For connecting to mssql db, declare an alias by selecting the datasource in the ejb application project. This can be done by right cicking the ejb application project and selecting add datasource.xml. After you do this you can do a jndi look up for this alias from your ejb code. Once you get the datasource you can get connection by calling ds.getConnection() method.
Let us know if you have any specific query.
Regards,
Shubhadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.