This is the code i am using to create connection.
i have put SQL Driver.tar in classpath.
But my program is showing following error:
Driver Loading problem
java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://localhost:1433;databasename=Questions
And is that .tar file really a .jar file with an unusual name? I expect it isn't. If it's really a tar file, then extract the jar file which I expect you will find in it, and put that jar file into your classpath. Java classpaths don't support tar files.
com.microsoft.jdbc.sqlserver.SQLServerDriver is the older SQL 2000 (and 7?) driver. Your JAR file is the SQL 2005 driver, and contains the class Jayesh mentioned. The connection string for it should start with jdbc:sqlserver:// instead of jdbc:microsoft:sqlserver://