How to connect to local host using JDBC?

前端 未结 2 1350
挽巷
挽巷 2021-01-06 07:30

I installed MySql on my own machine. I created database, create table, ... using MySql CommandLine Client. When working on a project in school, I connected to school\'s data

2条回答
  •  青春惊慌失措
    2021-01-06 08:21

    It looks like you left your username and password in the source you posted.

    I don't see why you can't just do

    DriverManager.getConnection("jdbc:mysql://localhost/chandb", "user, "pass");
    

提交回复
热议问题