aspose file tools*
The moose likes JDBC and the fly likes Transferring Data without JDBC from DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Transferring Data without JDBC from DB" Watch "Transferring Data without JDBC from DB" New topic
Author

Transferring Data without JDBC from DB

Sachin Dere
Ranch Hand

Joined: Jan 14, 2003
Posts: 80
Hi guys,
I have been asked to comeup with an app which will transfer Data from MySQL DB from one Server to another Server but without using JDBC. the reason is both these Servers cannot access each other as they are behind firewall.
OK, now im wondering if this is possible? I was thinking of having a Server App which will run on the Source Server and store data in a textfile. The Client will be at the destination server which will pick up tht file using TCP/IP or FTP and store it in DB. This Client will continously read that file and process the data.
guys, is this possible?
Please let me know pros and cons. We are talking about 6000 Records at one go.
thanks,
Sachin
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hmm. Sounds clunky. If you can't use JDBC I'd question whether Java is the best option. You might be better scripting the backup, and use the tools MySQL comes with to do this. Continuously reading the file is a problem though. If you are doing more than a backup and actually trying to keep the state of one schema the same as the other, thats more difficult.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Dammit, I was going to say clunky.

He's right though, trying to write your own middle layer will be unpleasant. If data can be inserted or updated at both ends you're in for a lot of trouble.

If the data can be kept to one-way traffic and you can gather a list of operations as deltas (ie individual database changes) you may be able to whack something together, but it still wouldn't be nice to work with.

Personally I'd look towards discarding one copy, and placing some code next to the single database instance to tunnel database access through an existing protocol, but depending on why your network is set up the way it is my solution may be even more evil.
Sachin Dere
Ranch Hand

Joined: Jan 14, 2003
Posts: 80
Hey guys,
thanks for the reply. Well,i just found out that one of the reasons for this setup is that the Source DB is not in our control and managed by somebody else and they have blocked all the ports for security reasons.Even though they have allowed us to put our application on their server.i hope this explains the problem ok now,i would like to know whats the best solution for this?i just have to get it working and i got the FTP Code ready which will simply FTP to the destination server.My Client app will read this file and insert all the records in DB. so i got this figured out. now the problem is the first part.what u guys think?
is this a good solution?any ideas?
thanks,
Sac
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Sachin,
I would recommend asking the source db owner for an export delivered to you in some secure fashion. Presumably, they are concerned with the security of the data. So it would be good to give them input on how it is transfered.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sachin Dere
Ranch Hand

Joined: Jan 14, 2003
Posts: 80
Hi Jeanne,
thanks for ur reply. Now i have come up with another major problem.They are asking me to do DataTransfer using Sockets instead of FTP. i explained them that its gonna be very slow reading data one by one from sockets.
Im really stuck here
thanks,
Sachin
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I second what Jeanne writes - it can be hard enough to write software without your colleagues basically working against you. If you have a justifiable need for the data, I'd expect a pretty compelling reason on his part why you can't have it in the format you need.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Sachin,
I would recommend asking your sockets question in our I/O forum. Just start a new thread there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transferring Data without JDBC from DB