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.)
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.
精彩评论