0

I have a java program(For android app) that connects to a MS SQL SERVER 2005 database. I get an error when I run it through eclipse:

java.sql.SQLException: Network error IOException:Permission denied

I am using jtds to connect:

String connString = "jdbc:jtds:sqlserver://localhost/DB_CHITS_MANAGER;user=sa;password=123456;instance=SQLEXPRESS;";
        String username = "sa";
        String password = "123456";

        conn = DriverManager.getConnection(connString,username,password);

        Statement stmt = conn.createStatement();
        ResultSet reset = stmt.executeQuery("select * from tb_branch");

I stopped firewall,enable tcp-ip in sql server,set the port as 1433. But its didn't work for me. the database name is the same. No mistake in that. Pls help me...

4

1 回答 1

2

该错误听起来像是您根本没有进行网络连接的权限,请尝试将其添加到您的清单中;

<uses-permission android:name="android.permission.INTERNET" />
于 2013-07-14T08:29:05.910 回答