• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JDBC for Android not connecting

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using the Microsoft SQL Server JDBC Driver 3.0 (I think it's the latest).

Here is my java (android) code:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
DriverManager.setLoginTimeout(120);
Connection conn = DriverManager.getConnection("jdbc:sqlserver://74.__.171.___:1433;DatabaseName=________;User=_____;Password=_____");

I have obviously underscored out some of the credentials. The SQL Server is 2008.

I am not able to connect, and the message I'm getting is the following:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 74.__.171.___, port 1433 has failed. Error: "Permission denied. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.". (I have underscored out some of the IP address of course).

Keep in mind, that I am using the android emulator, API level 8 (Android 2.2). Also, this database WORKS. I have tested the TCP/IP connection in management studio and it works within seconds. I have connected with the TCP/IP protocol with 3 different applications. It all works. PLEASE HELP!
 
reply
    Bookmark Topic Watch Topic
  • New Topic