• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Importing a SQLServer Schema using java

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to JDBC
reply
    Bookmark Topic Watch Topic
  • New Topic