Hi all,
Previously i connnect to SQL server 2005 with jTDS 1.3.0 and everything was OK.
Now i want to connect to SQL server 2012 with jTDS 1.3.1.
I have this ConnectionUrl, but i can not connect.
I tried different solutions.
Hard to say without any error message or other diagnostics, but I strongly suspect your new SQLServer has the SQL Browser service disabled or firewalled. In this case it cannot find the port of the SQL Server instance by instance name. You will have to add a ":port" to the URL after the IP address. The (semi dynamic selected) port can be seen in the SQL Server configuration manager, it is normally not 1433.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Berned Eckenfels:
Thx for reply.
Look, i have a ConnectionHelper class that Connection String is there,And in the other hand,in my main Activity,in onCreate method i made a new instance of ConnectionHelper and get its Connection to a CallableStatement,
Here is this :
I got NullPointExection in the line that i call prepareCall method, and As you know better,we got this when we call a method from null object,that means my ConnectionHelper object is null, and its null,cause it could not connect to the SQL Server.( Am i right? ) and it could not connect,cause of my Connection String.
All ports listen to 1433.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Previously i connnect to SQL server 2005 with jTDS 1.3.0 and everything was OK.
Now i want to connect to SQL server 2012 with jTDS 1.3.1.
I have this ConnectionUrl, but i can not connect.
I tried different solutions.
Could you please help me?
Hard to say without any error message or other diagnostics, but I strongly suspect your new SQLServer has the SQL Browser service disabled or firewalled. In this case it cannot find the port of the SQL Server instance by instance name. You will have to add a ":port" to the URL after the IP address. The (semi dynamic selected) port can be seen in the SQL Server configuration manager, it is normally not 1433.
@Berned Eckenfels:
Thx for reply.
Look, i have a ConnectionHelper class that Connection String is there,And in the other hand,in my main Activity,in onCreate method i made a new instance of ConnectionHelper and get its Connection to a CallableStatement,
Here is this :
I got NullPointExection in the line that i call prepareCall method, and As you know better,we got this when we call a method from null object,that means my ConnectionHelper object is null, and its null,cause it could not connect to the SQL Server.( Am i right? ) and it could not connect,cause of my Connection String.
All ports listen to 1433.
@Berned Eckenfels : Can SQL Server 2012 collation effect on connecting to DB via jTDS?
Last edit: Alireza Azadi 2015-11-05