Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
public interface DBMain {}
...
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
package suncertify.db;
public interface DB {...
Originally posted by Jonathan Wolter:
Thanks for your post.
For me Data.java must implement the sun provide DB.java interface. I wanted to use polymorphism for my Local and Remote objects (both would implement DB). But because Data.java threw method signatures that were incompatible with the requirements for RMI, I couldn't.
Fast forward to your suggestion: Add a business layer in to separate my application from the DAO*. Then, look at polymorphism in that business layer so that my remote and local objects can implement the same interface. That's my next step.
Thanks,
Jonathan
* http://en.wikipedia.org/wiki/Data_Access_Object
** http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
Originally posted by Alex Belisle Turcot:
Hi,
I was pretty sure my suggestion (earlier in this post) put an end to the ugly solution..
You use the same object either to create/use the local or remote implementation.
For me, this is a beautiful solution
Regards,
Alex
SCJP 1.4, SCBCD 1.3, SCBCD 5.0, SCEA J2EE, SCEA 5.0
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |