Database

Exception Details : com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPooledConnection.createNewConnection(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPooledConnection.<init>(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource.getPooledConnection(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource.getPooledConnection(Unknown Source)

Solution: open SQL Server Configuration Manager -> Protocols for SQL SQLEXPRESS, select Properties of TCP/IP. In the tab IP Addresses, set the TCPPort in section IPAll to 1433.




Problem: While trying to execute SQL updates I was getting error - ORA-00932: inconsistent datatypes: expected BINARY got NUMBER.

Cause: In the database, the table had a column with data type as RAW. But in the code a Long value was being sent.

Solution: Change the data type in the table to NUMBER. this solved the problem.