Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About UnicastRemoteObject

 
Rick Charles
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does a UnicastRemoteObject do ? And also how to connect the database using RMI ?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A UnicastRemoteObject is the super-class from which you extend RMI "server" objects.

And also how to connect the database using RMI ?


You connect to a database in an RMI program the same way you would in any other program (Which is a question for either the JDBC or the J2EE forums...). If you're asking how you connect to a database *using* RMI - that's not what RMI is used for...
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RMI is about a java object calling a java object in a distinct environment (and many other fancy things). You have to create a DAO object (jdbc) and call it from a RMI enabled object.
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The UnicastRemoteObject class defines a non-replicated remote object whose references are valid only while the server process is alive. The UnicastRemoteObject class provides support for point-to-point active object references (invocations, parameters, and results) using TCP streams.

Objects that require remote behavior should extend RemoteObject, typically via UnicastRemoteObject. If UnicastRemoteObject is not extended, the implementation class must then assume the responsibility for the correct semantics of the hashCode, equals, and toString methods inherited from the Object class, so that they behave appropriately for remote objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic