I know here is java Forum, but if somebody can help me, please give me solution.
Im searching about two days and still no success.
I have a android project in which i want to connect SQL Server 2012.
First of all,i searched and googled ,but no success.
I appreciate any help.
Before i connected to SQL Server 2005 and everything was OK.
Now i want to connect SQL Server 2012.
First of all, i went to SQL Server Configuration Management and enabled TCP/IP protcols for all IPs, and all listen to port # 1433.
And also enabled Named Pipes.
Then i go to firewall and add sqlservr.exe to programs(for dynamic IP)and also add port 1433 (TCP and UDP) for any connection.
My instance Name is default(MSSQLSERVER).
after i went to my android app,and add these lines to AndroidManifest.
OK, and then i went to my ConnectionHelper.java class and give this Connection String :
and also added these codes before this :
I use jTDS 1.3.0.
In MainActivity i create new instance of my ConnectionHelper class and give return connection to a CallableStatement.
It gives me RunTimeException ( I think because i call it in onCreate method of MainActivity) and NullPointException in the line :
I think because my ConnectionHelper class returns null,so the getConnection is null,so callableStatement can not be compiled and returns nullPointException.
And it returns null cause of my Connection String,am i right?
Can anybody help me with this?
I tried different Connection Strings but still no success.