• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transferring Data without JDBC from DB

 
Sachin Dere
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sachin Dere
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin,
I would recommend asking your sockets question in our I/O forum. Just start a new thread there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic