Home > Database > Mysql Tutorial > mysql-【求解】android利用JDBC直接调用MYSQL问题

mysql-【求解】android利用JDBC直接调用MYSQL问题

WBOY
Release: 2016-06-06 09:45:53
Original
1310 people have browsed it

mysqljdbc客户端连接电脑数据库android

最近正在忙活着毕业设计,关于android上的图书管理系统。系统大概是编写一个android的手机客户端,然后利用JDBC直接连接同一局域网的mysql数据库服务器来访问数据。
现在客户端做好了,后台数据库也运行了并且在eclipse上面测试过,利用一个JAVA测试通过JDBC访问mysql成功,但在客户端运行的时候就是死活无法连接。。。附上客户端的连接代码:

<code>public class DBUtil {    public static Connection getConnection(){Connection con=null;try{   Class.forName("com.mysql.jdbc.Driver");con=DriverManager.getConnection("jdbc:mysql://172.71.103.44:3306/test?useUnicode=true&characterEncoding=UTF-8","root","1234");           }catch(Exception e){e.printStackTrace();}return con;}</code>
Copy after login

androidmysql连接JDBC

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template