JAVA JDBC 各大数据库的连接字符串和连接类

oracle:

    driverClass:oracle.jdbc.OracleDriver

    url:jdbc:oracle:thin:@127.0.0.1:1521:dbname

mysql:

 driverClass:com.mysql.jdbc.Driver

   url: jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=true   注意: 高版本的 mysql 需要显示指定 useSSL

DB2

    driverClass:com.ibm.db2.jcc.DB2Driver

    url:jdbc:db2://127.0.0.1:50000/dbname

sybase

    driverClass:com.sybase.jdbc.SybDriver

    url:jdbc:sybase:Tds:localhost:5007/dbname

PostgreSQL

    driverClass:org.postgresql.Driver

    url:jdbc:postgresql://localhost/dbname

Sql Server

    driverClass:com.microsoft.sqlserver.jdbc.SQLServerDriver

    url:jdbc:sqlserver://localhost:1433; DatabaseName=dbname

    原文作者:PostgreSQL
    原文地址: https://www.cnblogs.com/lovling/p/6533347.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞