on 08-03-2016 10:40 AM
Hello Everyone,
I am making a SAPUI5 application where I need to use mysql database, to acheive that I created an Odata Service from :
I have two tables : Login, Session
I followed each and every step and I got the service:
When I am trying to read the data its working perfectly through the following code:
gatewayLoginLink = "proxy/http/localhost:8080/login/login.svc";
var path="/Sessions?$format=json"
var iModel = new sap.ui.model.odata.ODataModel(gatewayLoginLink, true);
iModel.read(path, null, null, true,
function(oData1,oResponse)
{
var oJSONmodel = new sap.ui.model.json.JSONModel();
oJSONmodel.setData({
modelData : oData1.results
});
alert("Successful");
},
function(oError) {
alert("Error");
});
But When I am trying to write through following code:
var value=
{
loginid:"11",
password:"1"
};
oModel.create('/Logins', value, null, function(oData,
oResponse){
alert("Success Create");
},function(){
alert("Error Create");
});
Its giving Error on console:
Kindly Help me out please.
If there is any different way to access mysql database through sapui5 app kindly tell me that too, it would be great help.
test ur service with postman first
make sure they are working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.