Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sqlServer connection

 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i want to create a connection with
sqlServer can someone tell me what are
the steps that i shoul do .
thx for any help
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go find yourself a SQL Server JDBC driver. Microsoft's or Sybase's websites (depending on which SQL Server) would be a good start. Then read the instructions it comes with and come back here if you have problems.

Jules
 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx for the help
 
Prashant Jain
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Micorsofts JDBC driver for SQL Server 2000 is freely available on their site.(Something is Free at Microsoft :-))The documentation is not very exhaustive but will definitely guide you through to configuring the connection.Here is a sample code,

public String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";

public String connectionString ="jdbc:microsoft:sqlserver://<<servername>>"+
";User=,,username>>"+";Password=<<password>>"+";SelectMethod=cursor";
Class.forName(driverName);
final Connection conn = DriverManager.getConnection(connectionString1);

Hope it helps!

Happpy Programming!
Prashant Jain
prashantjainn@yahoo.com
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!