| Author |
help needed
|
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Hi all I have a problem, which i want to discuss with all of u... I dont know , It's the right place to post this question... But it is somehow related to the database...... My problem is ....... <b> I have a swing JDBC application at one end..... and on other end , i have another swing application...... I am using the oracle server for jdbc.... Now at one(my) side , i have a control button to upload the table data from other side to my side..... when i click on upload button.........My application get connected to the the application at other side and fetch the data from the oracle server that side and simply dump the data into my oracle server......... I dont know how to perform this ........ if any body can tell me the way to do this........ {Bear edit: removed 'urgent'] [ September 14, 2005: Message edited by: Bear Bibeault ]
|
Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
|
 |
Roger Chung-Wee
Ranch Hand
Joined: Sep 29, 2002
Posts: 1683
|
|
|
Are you saying that you want to retrieve data from one Oracle DB and load it into another Oracle DB?
|
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
First EaseUp Your post semes to suggest you are trying to connect from one Swing application to another Swing application - is that correct? And what do you mean by "on the other side"? Do you have a client Swing application which connects to a server applciation (unlikely to be in Swing) which gives you access to the database? Or do you have two client side Swing applciations connecting to difference schemas? Can you elaborate?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Hi Roger and Paul 1. I want to retrieve data from one Oracle DB and load it into another Oracle DB I am using swing application on both side....... Application on one side is different from other side only because one side has upload functionality....... on clicking this upload button, application simply connect to the application on other side other side then take the data from local database server and return back to the application( having upload button) and then once i get the data, i can insert into my database server Am i clear to the point ???
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
I have to complete this project very soon and i m not getting any idea guys
|
 |
Sravan Kumar
Ranch Hand
Joined: Sep 11, 2005
Posts: 121
|
|
Why do you need swing on both sides? Can't you get this done with a simple application on either side? Even otherwise, it is enough you have a swing interface running on one side and an application on the other. When the button is pressed, call a method on the other side (using RMI, or socket connectivity). This method will return an Object[][] that will contain the records you want. You can then insert them in the local DB. If you can be a bit more clear with you requirements, you can expect more help.
|
keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Again, EaseUp. What you require is easiest accomplished by using the export and import tools supplied with Oracle, rather than writing your own. I'm still not sure what you mean by "other side" so I'm going to assume you have two client applications written in Swing. If that is the case, you need to write one which uses JDBC (or an ORM technology) to export the data in a known format (CSV perhaps, or as SQL INSERTS) to a text file(s) on the client machine. You will need to use java.sql.DatabaseMetaData to work out what tables exist, and export them accordingly. You will then have to write your other swing app which takes this file(s) and uses JDBC (or ORM) to import the data to the correct tables handling any differences between the schemas and logging errors. But I have to point out again - its a big effort to replicate functionallity which comes with Oracle. I assume you have your reasons for doing it this way though.
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Paul, U r confused with the word "other side"...But what u r thinking is right........I have two client application... May be i m getting ur point.... One client application use the JDBC to export the data into text file, and other client application pick this file and import into database...... What is the best way to connect two swing applications that resides on different locations So that the whole transfer process run without any problem.......
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Hi sravan My problem is ...... My client want to do the query from the combined data from all his sites... Suppose we have three of four same applications running on different locations...All these applications are storing and retreiving the data from their local database server.... Now if i want to collect the information from all the locations so that i can do the query from the combined data of all the locations.. what i want is , i simply tell my administration application the location of remote application and he should transfer the whole data of remote database server into the local database server once i collect the information from all the sites ....... i can do the query and provide the combine result of all the sites to the client.... I think it will help u to understand my real problem
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
What is the best way to connect two swing applications that resides on different locations So that the whole transfer process run without any problem.......
Don't bother trying to "connect" the two apps. Just upload the generate text files to a server and run your import app. from there.
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
But its two independent swing clients ........ I am not using any server in between
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
|
Should i use a web server in between my applications ???
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Originally posted by Sunil Kumar Gupta: But its two independent swing clients ........ I am not using any server in between
If you want to use two stand-alone Swing apps which need to communicate with each other you will need to come up with a mechanism to allow them to do this. You might consider JMS. That would give you a central point to which every client application could send messages to and listen to messages from.
Originally posted by Sunil Kumar Gupta: Should i use a web server in between my applications ???
You could create a web app which does this too. One client app could upload its data to a directory while the other polls the web server to see if any data has arrived. That being said, if this data is intended to be shared between multiple client applications why are you using multiple schemas? Why not have every app connect to one schema? Saves a lot of work.
|
 |
Sunil Kumar Gupta
Ranch Hand
Joined: Aug 26, 2005
Posts: 824
|
|
Thanks Paul I have no idea about JMS , I will try to check it... And in between i will also think the possibilities to keep my data at single place... Thanks again for ur valuable suggestion
|
 |
 |
|
|
subject: help needed
|
|
|