filmov
tv
Java JDBC Overview Installing MySQL Database

Показать описание
Java Database Connectivity with MySQL
:
To connect Java application with the MySQL database, we need to follow 5 following steps.
In this example, we are using MySql as the database. So we need to know the following pieces of information for the MySQL database:
Connection URL: The connection URL for the MySQL database is jdbc:mysql://localhost:3306/sonoo where JDBC is the API, MySQL is the database, localhost is the server name on which MySQL is running, we may also use an IP address, 3306 is the port number and snow is the database name. We may use any database, in such cases, we need to replace the snow with our database name.
Username: The default username for the MySQL database is root.
Password: It is the password given by the user at the time of installing the MySQL database. In this example, we are going to use the root as the password.
Let's first create a table in the MySQL database, but before creating a table, we need to create a database first.
:
To connect Java application with the MySQL database, we need to follow 5 following steps.
In this example, we are using MySql as the database. So we need to know the following pieces of information for the MySQL database:
Connection URL: The connection URL for the MySQL database is jdbc:mysql://localhost:3306/sonoo where JDBC is the API, MySQL is the database, localhost is the server name on which MySQL is running, we may also use an IP address, 3306 is the port number and snow is the database name. We may use any database, in such cases, we need to replace the snow with our database name.
Username: The default username for the MySQL database is root.
Password: It is the password given by the user at the time of installing the MySQL database. In this example, we are going to use the root as the password.
Let's first create a table in the MySQL database, but before creating a table, we need to create a database first.