You can specify the connection user name and password in this URL, and different databases have different labels. For example, the URL to connect to the SQLServer database on the local computer is as follows:
JDBC:SQL server://localhost; User = my user name; Password = * * * *;
Then establish a connection: connectioncon = drivermanager.getconnection ("JDBC: SQL server://localhost; User = my user name; Password = * * * *; " );
Extended data:
Programming of Universal URL for Database Connection
1, Oracle Bone Inscriptions
Driver: oracle.jdbc.driver.oracledriver?
URL:JDBC:Oracle:thin:@ machine _ name:port:dbname?
Note: machine_name: the name of the machine where the database is located; ?
Port: the port number, which defaults to 152 1.
2、mysql
Driver: com.mysql.jdbc.Driver?
URL:JDBC:MySQL://machine _ name:port/dbname?
Note: machine_name: the name of the machine where the database is located; ?
Port: Port number, default is 3306.