• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to know Sql version.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two instances of Sql server (2000 and 2005) installed.
In my application when i am coding
is showing output

Microsoft SQL Server 2000 - 8.00.2050 ......

.
i want to know how can i connect to 2005 server.
I am using Websphere studio ApplicationDeveloper as IDE and jdbc as

DataDirect ConnectJDBC type 4 driver for MS SQL Server, com.microsoft.jdbcx.sqlserver.SQLServerDataSource

.
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Siddarath,
Check the port no of each instance of SQL server and make sure to use the "2005 instance" port no in the connection string.
 
siddharth paul
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the default port no. 1433 in my Websphere application studio.
Also i checked in SQL Server configuration manager TCP/IP port is 1433 for both.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Can you show the jdbc connection string , and code used to connect 2000 ? and by which way are you connecting to DB ? DriverManager or JNDI Lookup ?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter how many instances of SQL Server you have installed on one machine, they all listen on port 1433 by default. It is the instance name that tells SQL server which instance you want not the port number. NB: I think the SQL Server docs suggest installing 2000 and 2005 on the same machine is unsupported - I can't remember exactly, but worth a check to make sure you aren't doing something that could cause you problems. If you need both on one machine, you can use an instance of 2005 in backwards compatability mode which limits it to 2000 behaviour.

SQL Server 2005 has the major version 9, SQL Server 2000 has the major version 8. So if you use DatabaseMetaData.getMajorVersion() you will be able to find out.


i want to know how can i connect to 2005 server.


Which JDBC driver are you using? If its the MS driver you need to define the instance name as part of the server name (see the documentation). If its jTDS you need to pass a property called "instance".
 
siddharth paul
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bala
I am doing JNDI lookup with jdbc v4 "DataDirect ConnectJDBC type 4 driver for MS SQL Server" in websphere.

Paul
thanks for you tips.

If its the MS driver you need to define the instance name as part of the server name.


How to do this.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't need to if you are not using the Microsoft driver. I'm afraid I don't know how to configure the DataDirect driver. But they should have documentation you can use?
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic