tags:

views:

18

answers:

1

I have a site running a Linux/Apache/MySQL/PHP stack. I would like to connect to the database from a locally run Java program. Is this possible? (Deploying the Java program to the server would be a great effort.)

+1  A: 

Yes, of course; as long as the Java program has the correct credentials, that the user it logs in with is given proper access from the database, etc.

From the perspective of the database, it has no idea who is connecting to it or what technology they are connecting from - all it sees is just another connection.

See Establishing a Connection in the same JDBC tutorial I linked to earlier.

matt b
I'm stuck on this line: `Class.forName ("com.mysql.jdbc.Driver").newInstance ();`. What do I put for the driver class?
Rosarch
these docs on the official mysql jdbc driver might help you out: http://dev.mysql.com/doc/refman/5.0/en/connector-j.html
matt b