各种数据库的jdbc配置

以前Mysql、MariaDB进行jdbc操作的时候,驱动都是com.mysql.jdbc.Driver,前一段时间,进行mariadb操作的时候突然不行了,现在对各个数据库jdbc配置进行总结,以备不时之需。

Oracle的配置

    //Oracle配置
    private static final String driver = "oracle.jdbc.driver.OracleDriver";
    private static final String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
    private static final String user = "root";
    private static final String password = "root";

Mariadb的配置

    //mariadb配置
    private static String driver="org.mariadb.jdbc.Driver";
    private static String url="jdbc:mariadb://localhost:3306/test_partition";
    private static final String user = "root";
    private static final String password = "root";

Mysql的配置

    //mysql配置
    private static String driver="com.mysql.jdbc.Driver";
    private static String url="jdbc:mysql://localhost:18000/mycat_pc";
    private static final String user = "root";
    private static final String password = "root";

 

(未完待续)

你可能感兴趣的:(mysql,java)