码迷,mamicode.com
首页 > 数据库 > 详细

JDBC 常用驱动类及url格式

时间:2016-08-06 08:14:58      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

1. oracle

     <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3.0</version>
        </dependency>

 

     String driver = "oracle.jdbc.OracleDriver";// 驱动类全路径名
        String url = "jdbc:oracle:thin:@//myhost:1521/myservicename";
        String username = "scott";
        String password = "tiger";

 

2. mysql

     <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.35</version>
        </dependency>

 

     String driver = "com.mysql.jdbc.Driver";// 驱动类全路径名
        String url = "jdbc:mysql://localhost/test";
        String username = "monty";
        String password = "greatsqldb";

 

3.

 

JDBC 常用驱动类及url格式

标签:

原文地址:http://www.cnblogs.com/zno2/p/4564277.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!