5

I want to use PHP to communicate with a java using shared database to communicate, please help me with sample code or logic.

Thank you.

EDIT:

I appreciate your suggestions, Yes I will be using both php and java to connect to thesame database.

The issue I'm faced with is that I want to know, do I have to create generic command that will be used for the communication? I'm trying to avoid dirty codes and ensure good programming techniques.

John
  • 61
  • 4
  • Are you saying you want to use the same database with a php program and a java program? – k to the z Apr 01 '11 at 18:13
  • If youre using the db essentially as a message transport layer then there isnt much of a sampel we can give you... you jsut need to access the database in each application and do whatever you need to do with the data. If you're having a specific problem edit the question with details about that problem. – prodigitalson Apr 01 '11 at 18:19
  • Or if you're really just looking for a message queue, you could just use a message queueing system like activemq. – whoughton Apr 01 '11 at 18:21

2 Answers2

1

For sure. Take a look this, will help you:

http://php-java-bridge.sourceforge.net/pjb/

devasia2112
  • 5,844
  • 6
  • 36
  • 56
1

Facebook developed Thrift for doing exactly what you are looking for.

Hope this helps Daniel

Daniel Cannon
  • 584
  • 1
  • 4
  • 13