This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection string

 
Yasir Qureshi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers
I am using MSSQL server, as backend database in my application
I want to know the connection string to connect to the MSSQL,
i.e
Class.forName(?,?,?)
DriverManager.getConnection(?,.....)
Is there any site which have all the connection strings for connecting with various databases.
regards
Yasir Qureshi
SCJP2
 
Yasir Qureshi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Still no reply,is there any one who help me in connecting to MSSQL server,
 
Ananya Bhushan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi yasir!
For getting connected to MSSQL server using a type one JDBC ODBC driver and tht too without creatign a DSN ya can do as follows:---
db = DriverManager.getConnection("jdbc dbc river={SQL Server};Server=ServerName;Database=MyDataBase","Username","Passwaord");
hope this solves ur problem.
 
Yasir Qureshi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot,
Can I connect with oracle(or any other database) by creating system or File DSN,I mean:
Class.forName("jdbc dbc:JdbcOdbcDriver);
con=DriverManager.getConnection("jdbc dbc:myDSN","scott","tiger");
If change myDSN to point to oracle or the database will it work?
Yasir Qureshi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic