开发者

Java: Connect to SQL on Apache locally

开发者 https://www.devze.com 2022-12-17 00:03 出处:网络
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 开发

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号