リンクを新しいタブで開く
  1. 6.2 Connection URL Syntax - MySQL

    Connecting to MySQL Using JDBC Driver

    In this tutorial, you will learn how to connect to the MySQL database using the JDBC Connec

    MySQL Tutorial
    JDBC Database Connection URLs for C…

    For reference, this article provides a summary of JDBC’s database connection URLs for th…

    CodeJava.net
  1. To connect a Java application to a MySQL database using JDBC, you need to use a specific URL format. The JDBC URL for MySQL follows a standard structure that includes the protocol, host, port, database name, and optional properties.

    Basic JDBC URL Format

    The basic format of the JDBC URL for MySQL is as follows:

    jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]
    コピーしました。

    Here is a breakdown of the components:

    • jdbc:mysql: This specifies the protocol and sub-protocol for MySQL.

    • host: The hostname or IP address of the MySQL server. If not specified, it defaults to localhost.

    • port: The port number on which the MySQL server is listening. The default port is 3306.

    • database: The name of the database to connect to. This is optional.

    • properties: Additional connection properties in the form of key-value pairs, separated by &.

    Example

    フィードバック
    ありがとうございました!詳細をお聞かせください
  2. Java – MYSQLデータベースに接続する方法を解説

    2025年4月15日 · JavaでMySQLデータベースに接続するには、JDBC (Java Database Connectivity)を使用します。 まず、MySQLのJDBCドライバ (通常は …

  3. 他の人も質問しています
  4. Jdbc URL Format for Different Databases - Baeldung

    • In this section, let’s discuss how to write the JDBC URL to connect to MySQL databases. To connect to a MySQL database from our Java application, let’s first add the JDBC driver mysql-connector-java dependency in our pom.xml: Next, let’s take a look at the generic format of the connection URL supported by the MySQL JDBC driver: Let’s see an example...
    baeldung.com でさらに表示
    • レビュー数: 2
    • 公開日: 2020年12月13日
  5. What is the MySQL JDBC driver connection string?

    2009年9月22日 · The way to retrieve the connection to the database is shown below. Ideally since you do not want to create multiple connections to the database, limit the connections to one and re-use …

    • レビュー数: 2

      コード サンプル

      String url = "jdbc:mysql://localhost/test";
      Class.forName ("com.mysql.jdbc.Driver").newInstance ();
      Connection conn = DriverManager.getConnection (url, "username", "password");
      stackoverflow についてさらに表示
      フィードバック
      ありがとうございました!詳細をお聞かせください
    • Connecting to MySQL Using JDBC Driver

      In this tutorial, you will learn how to connect to the MySQL database using the JDBC Connection object from a Java program.

    • Java Database Connectivity with MySQL - GeeksforGeeks

      2025年10月4日 · To connect Java to MySQL, you need: 1. Driver Class: com.mysql.cj.jdbc.Driver. 2. Connection URL: jdbc:mysql://localhost:3306/mydb. …

    • JDBC Database Connection URLs for Common Databases

      2022年3月2日 · For reference, this article provides a summary of JDBC’s database connection URLs for the most common databases including MySQL, SQL Server, Oracle, PostgreSQL, Apache Derby (Java …

    • How to Find MySQL Username, URL, Host & Port for JDBC: Step-by …

      2025年12月3日 · Finding your MySQL username, host, port, and constructing the JDBC URL is foundational for connecting Java applications to MySQL. By following this guide, you can …

    • Java JDBC connection string examples - alvinalexander.com

      2024年8月1日 · Some days we all need something simple, and today I needed the example syntax for a JDBC connection string (the JDBC URL) for MySQL and Postgresql databases. While I was digging …

    • MySQL :: MySQL Connector/J Developer Guide :: 6.3 Configuration …

      2010年6月3日 · Configuration properties can be set in one of the following ways: As a JDBC URL parameter in the URL given to java.sql.DriverManager.getConnection(), java.sql.Driver.connect() or the …