Results 1 to 7 of 7
- 12-12-2011, 08:49 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 65
- Rep Power
- 0
Connecting Classes On 2 Computers Question Jtable
Hey, Thank you for taking the time to read my question! I set up a jtable and a seperate adding class.
I then added a action listener to the jtable so that it would be informed whenever I made a change to it.
It works sucessfully when performed on the same computer, however; whenever I try it from a remote computer it is not aware that the change has been made.
The program works when I use it on the other computer it is just not aware the the data was added and has to be manually refreshed.
I was wondering what I should use to get this to work? Is connectiong pooling at all on the right track, or how do I get it to know that another computer has made a change?
--I just looked up some more information on java and noticed that I set up a connection to mysql from each program, however, I never set up any connection between the computer or servers, I hope this helps !
Thank you for any imput or insight!Last edited by kevinn205; 12-12-2011 at 09:18 PM.
- 12-12-2011, 10:13 PM #2
Re: Connecting Classes On 2 Computers Question Jtable
How do you expect the data on one computer to be seen by a program on another computer?
What is the communication channnel between them
or where is the common place that they can both see?
- 12-12-2011, 10:16 PM #3
Member
- Join Date
- Nov 2011
- Posts
- 65
- Rep Power
- 0
Re: Connecting Classes On 2 Computers Question Jtable
My exact thought :/ It's certainly possible though right? Would it involve networking using tcpip? know of any starting place?
currently they both send data to mysql that they can both read, but i made it so i have a refresh button or as they add the data they refresh it, I'm assuming i need to do more work on the way that it refreshes data when it adds it
perhaps some kind of connection to all devices on the network that have the jtable program open?Last edited by kevinn205; 12-12-2011 at 10:18 PM.
- 12-12-2011, 10:22 PM #4
Re: Connecting Classes On 2 Computers Question Jtable
Sorry, I have no experience with databases on a network.
- 12-12-2011, 10:28 PM #5
Re: Connecting Classes On 2 Computers Question Jtable
You should get some traffic here.
- 12-13-2011, 12:24 AM #6
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,605
- Rep Power
- 5
Re: Connecting Classes On 2 Computers Question Jtable
There are many ways to do this, but none that come to mind are trivial. Most solutions I can think of involve a central application server that is notified when a Client launches/closes (so it knows whom to notify). When an update occurs (either through the server application itself using RMI or Networking, or via a trigger in the database) the app server then notifies all listening clients of the change, again through RMI or a socket. The following links are tutorials that delve into the nitty gritty
Lesson: All About Sockets (The Java™ Tutorials > Custom Networking)
Trail: RMI (The Java™ Tutorials)
- 12-13-2011, 06:12 PM #7
Member
- Join Date
- Nov 2011
- Posts
- 65
- Rep Power
- 0
Re: Connecting Classes On 2 Computers Question Jtable
Thank you very much! that was what i was looking for,
so it is best to connect all of the computers to my server which is running mysql but use a mysql and a networking connection. I will need to set up a listener to know that one computer has made a change then notify all other computers of the change.
If anyone reads this do you think static vs dynamic ips will be alot different (dynamic might be harder?)
and i think ill start with socket since i already have created client server softare in it :D ( any significant reason not to?)
Similar Threads
-
java question on classes & objects
By joe98 in forum New To JavaReplies: 16Last Post: 04-08-2011, 09:45 AM -
Jtable gives error when connecting to mySQL
By Mv.c9 in forum NetBeansReplies: 0Last Post: 03-07-2011, 05:11 PM -
question about abstract classes
By TheFlying_Boy in forum New To JavaReplies: 6Last Post: 07-08-2009, 07:19 AM -
problem with connecting to another computers database
By rakesh_n_mehta in forum JDBCReplies: 0Last Post: 12-24-2008, 10:35 AM -
Connecting JTable With Microsoft SQL Server 2005 or Oracle
By WNIGAGLIONI in forum JDBCReplies: 0Last Post: 12-16-2008, 08:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks