• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Importing a SQLServer Schema using java

 
Ronan Dowd
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Does Java have any support for importing a SQL Server database ?

I have a SQL Server database schema which I've backed up. So it's called something like "ms-schema.bak"

Basically my application needs to take in as input a database backup (i.e a bak file) and actually restore the database

Any help would be great on this..

Thanks, Ro.
 
Henry Wong
author
Marshal
Pie
Posts: 21423
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the JDBC driver for SQL server...

http://msdn.microsoft.com/en-us/data/aa937724.aspx

With this, you should be able to get to SQL server, with Java via JDBC. Now, how to do the restore and stuff, I guess that is a SQL server capability.

Henry
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a little search, and it seems that there are SQL commands for restoring a database. See: this Google Search. What commands and how to use them depend on version of SQL Server, and where your files are stored.

Some of those search returns suggest there is a command line you can use to restore a DB, but I didn't read enough to know if it was custom written, builtin to the the SQL Server bin directory, or a third party product.
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic