如何在Android中通过JDBC连接到PostgreSQL服务器? [英] How to connect to a PostgreSQL server via JDBC in Android?

查看:178
本文介绍了如何在Android中通过JDBC连接到PostgreSQL服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要连接到局域网中的一个PostgreSQL服务器没有Web服务。 目前,我认为JDBC是我可以考虑的唯一途径。

I have to connect to a PostgreSQL server in LAN without web service. At the moment I think JDBC is the only way I can consider of.

我怎样才能实现呢?有没有现成的使用第三方库,我可以导入到我的Andr​​oid项目?

How can I fulfill this? Is there any ready-to-use 3rd party library I can import to my Android project?

任何答复将是AP preciated。

Any reply would be appreciated.

推荐答案

如果移动设备和数据库服务器之间的直接连接,真的是你想要的东西(的安全问题),那么你就不需要任何额外的图书馆吗?刚刚部署在Android上的JDBC驱动程序,我想......?

If a direct connection between mobile devices and the database server is really what you want (no security concerns) then you wouldn't need any additional library? Just deploy the JDBC driver on android, I guess...?

这是另一种选择是创建在PosgreSQL服务器前面一个小型的Web服务器,包含JDBC驱动程序。然后,你可以定义发送/通过HTTP接受SQL /结果集的一个简单的协议。这样做的好处是,在移动装置上应用程序的足迹较小

An other option would be to create a mini web server in front of the PosgreSQL server, containing the JDBC driver. Then you could define a simple protocol of sending/receiving SQL/resultsets via HTTP. The advantage of this is, your application footprint on the mobile device is smaller.

这篇关于如何在Android中通过JDBC连接到PostgreSQL服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆