473,420 Members | 4,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

how to copy database as it is to a new database by java code

Hi

I want to ask about how to copy database as it is to a new database by Java code.

I mean to copy the database all at once by one code, not table by table.

Thanks in advance.
Aug 4 '10 #1
3 2928
johny10151981
1,059 1GB
what database are you using?
Aug 5 '10 #2
Thank you for replying

I use Microsoft SQL Server 2008

Thanks
Aug 6 '10 #3
chaarmann
785 Expert 512MB
So do you want to copy all the binary files? You can do that easily with Explorer. (Or you can use FileUtils from Apache Commons to copy files with Java). I am not sure if this works with Microsoft SQl-server, but for MySql copying the database table files to another database worked fine for me.
Another way is to make a database-dump as sql-statements from the old database and then run them on your new database. This way the old and new database need not to be the same.
The other way is reading the data table by table through JDBC (or Hibernate) and copy them, only then you need java code to do so. But this way you said you don't want.
Aug 6 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Ravi | last post by:
Do we have anything that could convert C++ code to java code? To what extent are such tools reliable? TIA. -- main(){char s="sbwjAeftqbnnfe/dpn!ps!CSbwjACjhgppu/dpn"; int...
2
by: Fabius | last post by:
Hello all. I need transfer a db2 database ( tables, records ecc. ) from a server1 to server2. The operating system of server1 and server2 is win2000 server. I have installed db2 to server2. Now...
5
by: Chand | last post by:
Private Sub tbDate_AfterUpdate() Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset rst.CursorLocation = adUseClient Set cnn = CurrentProject.Connection rst.Open "SELECT * FROM...
0
by: serge | last post by:
I have 2 SQL Enterprise Editions running SP2 and same collation. When i try to start database mirroring I get the following error message: "The remote copy of database "ABC" has not been...
4
by: mjahabarsadiq | last post by:
HELLO FRIENDS I HAVE ONE JAVA CODE WHICH PARSES AN XML FILE AND PRODUCE A QUERY TO CREATE TABEL IN A DATABASE. BUT I NEED THE CODE TO BE USED IN A JSP PAGE. HOW TO USE THIS PAGE WITH JSP. ...
5
by: smileskhan | last post by:
Hay Friends... Here I started a new and interested thread. I hope you also enjoy it. I got a task to creat a Hospital Database in Java. But I don´t have any good clues abouts it....
0
by: shweta gandhi | last post by:
hi, ]Someone know how to create database dyndmically in postgreSQL through Java code? How to check particular database exist or not in postgreSQL through java code? such as we can see in sql server...
1
by: ponvijaya | last post by:
I want to take back up of records in My MySql Database I want to convert the records into csv file and store in a location. If needed I want to import it to the same database.. I need to...
5
by: Steve | last post by:
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. ...
10
by: minakari | last post by:
I have a sql file ,how can I create DataBase in java I mean how can I restore my sql script with java code,isther any sample?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.