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
2010-01-22 00:56:45
I'm stuck on this line: `Class.forName ("com.mysql.jdbc.Driver").newInstance ();`. What do I put for the driver class?
Rosarch
2010-01-22 02:55:51
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
2010-01-22 15:47:53