언어 설정

Menu
Sites
Language
How to make server for tizen web app?

I used Apache Tomcat, JSP, MySQL.

On eclipse, I used JSP to print the DB on browser. It's local server.

But I have to send some datas to DB via web server.

What should I prepare for making web server? Such as JSP, Ajax, PHP, Apache, Linux...

What is the best coordination?

And using the node.js for making server is possible on Tizen Studio??

I want to know full system of web server for tizen web app.

Thank you.

Edited by: 명훈 심 on 05 2월, 2018

Responses

8 댓글
Iqbal Hossain

hi, You may prepare your server using any framework or platform that is not dependent. You may prepare a REST service using Java / PHP / Node.JS ... and host it on a public domain or IP.. 
After that consume that REST service using Ajax call or XMLHttpRequest from Tizen Web App.
Here is a demo REST service consuming code.. https://stackoverflow.com/questions/40590871/auto-generated-code-from-rest-viewer-not-working-in-tizen-idewearable-web-app/40602735#40602735

명훈 심

Thank you.

In tizen webapp,  can I use the Linux server IP instead of url?? 

url: "http://rest-service.guides.spring.io/greeting" - > url:"198.xxx.xxx.xxx" like this

I borrowed cloud service, Linux Ubuntu. I want to make DB server on Linux and connect my web app and DB server.

I think DB connection in tizen web app with ajax or web. And make DB server that consist of mysql or maria DB in Linux. Is it right?

It's first time to make server. So now I'm confused...

명훈 심

Should I use node js in tizen web app like below?

https://www.w3schools.com/nodejs/nodejs_mysql_create_db.asp

명훈 심

I will try this codes...

 

var Client = require('mariasql');

var c = new Client({
  host: '127.0.0.1',
  user: 'foo',
  password: 'bar',
  db: 'mydb'
});

c.query('SELECT * FROM users WHERE id = :id AND name = :name',
        { id: 1337, name: 'Frylock' },
        function(err, rows) {
  if (err)
    throw err;
  console.dir(rows);
});

c.query('SELECT * FROM users WHERE id = ? AND name = ?',
        [ 1337, 'Frylock' ],
        function(err, rows) {
  if (err)
    throw err;
  console.dir(rows);
});

c.end();
명훈 심
var connection = new ActiveXObject("ADODB.Connection") ;

var connectionstring="Data Source=<server>;Initial Catalog=<catalog>;User ID=<user>;Password=<password>;Provider=SQLOLEDB";

connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");

What should I put in the ActiveXObjec(""); and <server>, <catalog> <- ??

ps. Is it possible to insert the php code for db connection to the html codes?

Iqbal Hossain

Directly db access is not recommanded ( you may read this on stackoverflow post given in previous comment).... You may write a PHP, Java web server which fetch data from the DB server.... from your app you will call web server to get data...

명훈 심

Okay, Thank you!