What is the best and secure way to access remote MySQL database- [closed]

若相惜 发表于 7 天前 | 显示全部楼层 |阅读模式


您需要 登录 才可以下载或查看,没有帐号?论坛注册

What is the best and secure way to access remote MySQL database? [closed]

so i come up with 2 different ways to query database, both solutions are communicate trough    http requests
and both methods have their own advantages and disadvantages  
  i am using below example for demonstrate solutions
  database on the server

      name  price
Apple          10
Banana          5
    lets say i want to get all the fruit items from database
Solution 1: write database access class using     php
in Server side and let java application send query via http requst   
ex: java application will send query      SELECT * FROM fruit
then server side      PHP
will return query result as `JSON’ format   
this is super reusable and can use for any future cloud database access and it is clean code because all the implementations are don in    JAVA
side except database access  
Solution 2: Write both Fruit class and database classes in server side and let      JAVA
application to call server side functions via      http
its like      getAllFruits()
  in this way i have to implement all the DAO classes in server side and it is more coding,less re usability in another project also since DAO is implemented in PHP side maintenance effort is higher than solution 1
i think Solution 1 is the best because of re usability and simplicity, i am afraid that database query will be sent via    http
request which is not feel good for me, so i really appreciate your ideas and comments since i am new to this kind of applications, if you have any other solutions or Advantages and disadvantages i am also open for those  
  also i was wondering about how other companies implement it

本文数据库(mysql)相关术语:navicat for mysql mysql workbench mysql数据库 mysql 存储过程 mysql安装图解 mysql教程 mysql 管理工具
主题:  MySQL、SQL、PHP、linux、Apple、Mango、

tags:  database,side,query,access,am,via,solutions

您需要登录后才可以回帖 登录 | 论坛注册


!jz_fbzt! 快速回复 !jz_fhlb! !jz_gfqqq!
快速回复 返回顶部 返回列表