+ 3
Jdbc connectivity of a simple java program to a xampp mysql server remotely located on googlecloud instance.
I want to connect my java program to the database that is created on remote cloud (google cloud instance) through xampp I've red this code : Class.forName("com.mysql.jdbc.Driver"); String url= String.format("jdbc:mysql://x:3306/y"); connection = DriverManager.getConnection(url, z, w); Where x is your instance IP (get it from the panel), y is the instance name, z is the database (not account) and w is the user password. Where will i write my database name? Correct me if I'm going wrong somewhere.
5 Antworten
+ 6
I have no experience with Java database applications, but I found this link related to JDBC, hope it could come of use somehow, if you still haven't solved the case.
https://www.tutorialspoint.com/jdbc/jdbc-sample-code.htm
Hth, cmiiw
+ 5
check this, may be helpful
https://code.sololearn.com/cJS99uoDiWsB/?ref=app
+ 3
@Ashish Maheshwari I am glad if it helps you with your problem. Good job buddy ; )
+ 3
thank you for your help.
+ 2
Hello @ipang thanks for answer, the link you shared is correct. The main point is you have to replace "localhost" that you are using (x:3306) to the instance ip address. And rest is just database name and user pass. ✌️