JDBC的数据库连接

    技术2022-05-20  78

    //MYSQL Class.forName("com.mysql.jdbc.Driver");

    ("jdbc:mysql://localhost:3306/test","root","root");

    /Oracle

     Class.forName("oracle.jdbc.driver.OracleDriver");

    ("jdbc:oracle:thin:@127.0.0.1:1521:orcl","SCOTT","Scott");

    /SQL Server

     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

    ("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=sqlserver2005_test","haha","haha");

     


    最新回复(0)