Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 jdbc problem

Author  Topic 

grizzlee
Starting Member

6 Posts

Posted - 2008-05-21 : 04:36:12
Hi
I have a java program which uses sql.It supports sql 2000 and 2005.The user can enter a command from which he can choose to what server type he wants to connect.It is something like :

" c:\connect [jdbc driver for 2005] [server] "

Now i have to do some different operations when user connects to 2000 and other operations when user connects to 2005.
The problem is that when using jdbc driver for 2005 he can also connect to mssql server 2000.
How can i find out to what server type he is connecting to?

i hope i explained it clearly enough
thanks

henriquerey
Starting Member

3 Posts

Posted - 2008-05-21 : 14:02:55
Have you tried connection.getMetaData()?
It returns a DatabaseMetaData object with a lot of information about the DB you're connecting to.
maybe its getDatabaseProductVersion() method returns what you want.
Go to Top of Page
   

- Advertisement -