This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC SQL Server 2008 Express Vista and XP

 
Claude Cundiff
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 http://msdn.microsoft.com/en-us/library/aa342339.aspx , 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



NOTES:
- 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.

Claude
 
Paul Clapham
Sheriff
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
chaitanya palli
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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.
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic