on 03-22-2017 2:23 PM
In our SAPUI5 application we need to connect to SQL Server Database 2012 and ECC.We deploy our SAPUI5 applications as BSP applications.
To access ECC data we are using ODATA services.Connecting to SQL Server database from SAPUI5 application is new to us.
So we created a SAPUI5 POC. I created a button. On click of this button, in the controller, I am using a Ajax call to the servlet to connect to the database and pull the data. This is deployed on local tomcat server and this works fine.
Problem is when i deploy this SAPUI5 application as a bsp application. I am getting "404 - Not Found Error". Please suggest.
In Web.xml
<servlet> <description></description> <display-name>HelloWorldTest</display-name> <servlet-name>HelloWorldTest</servlet-name> <servlet-class>com.helloworld.servlets.HelloWorldTest</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloWorldTest</servlet-name> <url-pattern>/HelloWorldTest</url-pattern> </servlet-mapping>
In Controller.
clickTheButton : function() { $.get('HelloWorldTest', {}, function(responseText) {
alert(responseText); $('#jqueryajaxGetUserServletResponse').text(responseText); }); }
Please help me out with this. Also suggest what is the best approach to connect to a SQL Server database from SAPUI5 application.
Hello Sravan,
The issue this wont work is because your servlet is a java application and your tomcat is a basically a Java application server and it works. The moment you transfer the application to abap server , and it cannot run abap application and hence this error. It is a different case if you move to HCP which can run html and java applications .
Now let us come to the case of accessing the external Database from Abap -
You can compare the 2 options . They would on the factors like use of 2 servers vs just a single abap server.
Thanks and Regards,
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you have to give full url for that ajax call and you have to enable cors if not the ajax call will fail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sravan,
I know of two options, there can many other options also.
1) The reason you are getting 404 error is due SAP server is unable resolve the your SQL database IP ( I assume that this database is not your SAP database). Reason is when you deploy UI5 application it sits in your SAP server. to resolve the it , you need see that your SQL server pings from SAP server from os level and vice versa. If this is a production system then it is not that secure.
2) Second option, Make your SQL server as secondary database(your basis team can help you). Then you can implement your application logic using Odata framework. rest everything remains same as your odata ui5 development. This lot more secure and you will have better control.
Thanking you
Vengaiah
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 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.