Java can't connect to named instance of SQL server 2005


I'm having an issue connecting to a named instance of SQL Server 2005 from within a Java program.
I'm issuing the following command:

if( dbtype.equals("ora") )
{ new );
if( dbtype.equals("sql") )
{ new Packages.mks.frame.sql.jdbc.mssql.Driver() );
con = new url, dbuser, dbpass );
con.setTransactionIsolation( java.sql.Connection.TRANSACTION_READ_COMMITTED );

The variable "url" is set to:

When I run the command, I get the following exception:
      java.sql.SQLException: Unknown server host name 'cgcsqldev\sql2005'.

I've been reading that Java doesn't like named instances of SQL server. The identified solution was to use the default instance and specify a port number since, technically, each instance should be running on its own port. However, this is not the case at the client that I am at right now. All instances (named and default) are listening on port 1433.

Is there any way for me to connect to a named instance of SQL Server 2005 through Java without requiring that it use a different port?

Thanks a lot.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Marten RuneSQL Expert/Infrastructure ArchitectCommented:
No. but you can find out witch port your named instance is using.

Fire up 'SQL Server Configuration Manager' and from there its easy. Now connect using this port.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James MurrellProduct SpecialistCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.