Exposing MySQL database/table using REST

2020-01-30 08:00发布

What would be the easiest way to expose a MySQL database using a REST interface?

The only guidelines that I can find on the Internet is just using NetBeans. I am not a big fan of NetBeans...

I'd like to retrieve that and be able to update data on the database using this REST interface.

FYI, this is for an iPhone application that I am currently working on.

标签: mysql rest
15条回答
我只想做你的唯一
2楼-- · 2020-01-30 08:10

If a Java backend is ever pursued, have a look at an answer I posted for Need to write a RESTful JSON service in Java that outlines the steps you can take to connect to the database and create a RESTful Web Service using the following.

  • IDE: Eclipse IDE for Jave EE Developers (Kepler), comes with Maven built in
  • Database: MySQL (also makes use of MySQL Workbench)
  • Application Server: GlassFish 4.0
  • Java EE 7
    • Jersey for JAX-RS (default implementation in GlassFish) RESTful service layer.
    • EclipseLink for JPA (default implementation in GlassFish) Persistence layer.
  • Any REST Client for testing: (eg Postman)
查看更多
放我归山
3楼-- · 2020-01-30 08:11

Chiming in I came across loopback.io and have been toying with it. It's a great tool for easily creating api end points for mysql. You can install a mysql connector and then it discovers all your mysql tables and you can create them into models. I don't really know much programming but it's easy enough where I got an api for my sql working in a day. I have 19 tables and it easily created my end points.

http://loopback.io

查看更多
狗以群分
4楼-- · 2020-01-30 08:12

Seems MySQL is getting REST interface natively, so we can query the DB, without a need for server... :-)

http://www.infoq.com/news/2014/09/MySQL-REST

查看更多
The star\"
5楼-- · 2020-01-30 08:13

2017 Update:

PHP: Another good player in the field is https://slimframework.com

Python: http://python-eve.org/

For people finding this in 2015, potential solutions that are still working/under development as of Oct are:

Haskell (binary): https://github.com/begriffs/postgrest

Java: http://restsql.org/

PHP: https://github.com/moddity/Rester/

查看更多
Emotional °昔
6楼-- · 2020-01-30 08:16

You should also consider using DataDirect's Hybrid Connectivity Services for this. They can help you quickly restify your database . To get started, you refer to the following product pages:

  1. REST API (OData) for MySQL Community Edition
  2. REST API (OData) for MySQL Enterprise Edition

Disclaimer: I work for DataDirect, but please note that I genuinely believe that you should be looking at these solutions.

查看更多
不美不萌又怎样
7楼-- · 2020-01-30 08:17

NetBeans is just an IDE. It has nothing to do with REST. If you are using Java, take a look at Restlet or Jersey. I personally prefer Jersey, but both works.

查看更多
登录 后发表回答