File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC SQL Server 2008 Express Vista and XP  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC SQL Server 2008 Express Vista and XP  " Watch "JDBC SQL Server 2008 Express Vista and XP  " New topic

JDBC SQL Server 2008 Express Vista and XP

Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
Hello everyone,

I'm having a time with SQL Server 2008. If only they'd let me use MySQL

So, using the example right from Microsoft , I have tried to get a sample database "s" to connect.

I know that it works on my machine because I'm running SQL Server Management Studio and that's where I created the database "s".

When I log into SQL Server Management Studio, I do something like this:

Server name: SomeServerName
Authentication: Windows Authentication
User name: (not enabled) computerName\name
Password: (not enabled) nothing_just_whitespace

So, with that, I try to connect using JDBC by using the following connection string:

In which case, I get

- I've tried it without "Windows Authentication" but with a user and have also left both out. Neither case works.

Again, I appreciate your help.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

You'll have to configure the SQL Server so that it accepts TCP/IP connections. Make sure you know what port it's listening at, 2008 might decide to use a different port than 1433 (I have no idea whether it does or not). Configure a user ID and password for the database you want to connect to (also in the server) and use that user ID and password in your connection URL. Review the documentation to make sure your connection URL is formatted correctly.
Mahesh Kedari
Ranch Hand

Joined: Nov 28, 2009
Posts: 111
Well the userName and password you have given are incorrect.

And better you use "SQL Server Authentication" mode when you are connecting through java.
but for that you need to enable TCP/IP Connection type.
For doing that, go to SQL Server Surface area configuration > Surface area configuration for Services And Connections > $Your_DB_Instance > Database Engine >Remote Connections

For understanding the differences between these two types please refer this

Use username sa and password which you have given at the time of instance creation. Please note that you can also reset the password for "sa" through windows authentication mode. So not a problem if you dont know the password.

Mahesh Kedari - Fidus Technologies Ltd.
chaitanya palli

Joined: Feb 19, 2010
Posts: 13

Someone gave me a MySql dump text file and I am trying to recreate the database in question on a different machine.

I installed MySql 5.1.44-winx64 on the machine. It is a brand new installation.

When I execute the command
mysql -u root -p {path}\create_database.sql

I get this output:
Enter password:<password is entered>
ERROR 1049 (42000): Unknown '{path}\create_database.sql'

Do I have to create the database first to recreate it?
I don't know anything about the source database.

What is the correct procedure for restoring a new database onto a machine with NO databases on it?

Thanks in advance.

Spread Smiles
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Hi Chaitanya.

This thread is related to a Microsoft Sql Server problem.
You will have a better chance to get help if you create an new thread for your MySQL issue.

Regards, Jan

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: JDBC SQL Server 2008 Express Vista and XP
It's not a secret anymore!