Archive: ‘JDBC’ Category

Six Possible solutions for JDBC – SQL Server Connection problem

11 comments March 31st, 2008

Here in this post I am writing about some possible solutions of JDBC – MS SQL server connection problem. During my work I had faced this problem and tried a little hard to findout the solution. In our project when we tried to connect to MSSQL Server, through its default port 1433 it thrown an exception as follows. Hope this will be helpful to you.

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.

java.net.ConnectException: Connection refused: connect

If you created the database and you are sure about your connection string then please check the following points.

  1. First Check the port which we are given is free or not. If any other connection is using this then please specify other port.
  2. Check the TCP/IP configuration in “MSSQL surface area configuration”. And if its disabled then make it enable.
  3. Check the Windows Firewall. It may obstruct the port accessing. So please disable it or allow this port accessing through the firewall using windows firewall configuration.
  4. Check if there is any antivirus software is running and it comes in between or not.
  5. Check the Dynamic port allocation of SQL Server is set or not. If it sets to ZERO or any other port then make it ‘Blank’. [making Blank is important] Give the static port number we want to the port number place. These configurations we can do in “SQL Server Configuration manager”. Give IPALL = 1433 also.  This information will set in the following part of the windows registry HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Microsoft SQL Server> MSSQL.1 > MSSQLServer > SuperSocketNetLib > Tcp> IP1/IP2/IPALL. If it’s not changing there we can manually change it.
  6. Then also its not working then please check the Windows Registry where we sets the “SQL Instance’s port number”. If it is different then please set that to our port number. It’s in HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Microsoft SQL Server > [Instance name] > MSSQLServer > SuperSocketNetLib > Tcp and change String value TcpPort = 1433.

Are are you reached here? Thanks for reading my full post :) becouse if u are a person who is facing this problem then I am sure you will not reach here, before itself it should solve :) And then also you are here then please check your connection string properly. I am giving an example here.

jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://servername:1433;DatabaseName=DBName;SelectMethod=cursor

Technorati Tags: ,,
Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

Popularity: 22% [?]

Bookmark this on BuzzURLBookmark this on BuzzURL Post to TwitterTweets for this web page Bookmark this on FC2 Bookmark newsing it! Choix it! Add to Google Bookmark Bookmark this on Delicious Digg This

HSQLDB: a lightweighted relational database

No comments November 21st, 2006

hsqldb.gif

HSQLDB is a relational database engine written 100% in Java , with a JDBC driver. This supports a subset of ANSI-92 SQL. It is best known for its small size, ability to execute completely in memory and its speed. It offers a small (about 100k), fast database engine which offers both in memory and disk based tables. Embedded and server modes are available. Additionally, it includes tools such as a minimal web server, in-memory query and management tools (can be run as applets or servlets, too) and a number of demonstration examples.This is currently being used as a database and persistence engine in many Open Source Software projects and even in commercial projects and products! It is free under the Modified BSD License.

HSQLDB home : here
Features of hsqldb : here
Known problems with hsqldb: here

Technorati Tags : HSQLDB,

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

Popularity: 1% [?]

Bookmark this on BuzzURLBookmark this on BuzzURL Post to TwitterTweets for this web page Bookmark this on FC2 Bookmark newsing it! Choix it! Add to Google Bookmark Bookmark this on Delicious Digg This

The new attractive features of JDBC 4.0

No comments September 9th, 2006

Java SE 6.0 is expected to be released in October 06. An important part of the new version of Java is the new JDBC 4.0 API. JDBC 4.0 brings several changes to JDBC, but its top priority is making things easier for developers.

Interesting developments in JDBC 4.0 are:

1. No need to explicitly load JDBC drivers using Class.forName() to register a JDBC driver. The DriverManager class takes care of this automatically.
2. Java SE Service Provider mechanism as another means to specify database drivers
3. Specify SQL queries using Annotations
4. Bundled database based on Apache Derby
5. SQL 2003 support, including support for XML as a native database data type
6. Improved exception handling with new exception classes
7. A new DataSet interface. When used in a connected mode, the DataSet functions in a manner similar to ResultSet. A disconnected DataSet functions in a manner similar to a CachedRowSet. You can navigate, modify and delete records in a DataSet.

Technorati tags: JDBC, java

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

Popularity: 1% [?]

Bookmark this on BuzzURLBookmark this on BuzzURL Post to TwitterTweets for this web page Bookmark this on FC2 Bookmark newsing it! Choix it! Add to Google Bookmark Bookmark this on Delicious Digg This