数据库URL连接示例及常用属性介绍

数据库URL连接示例及常用属性介绍:
常用数据库URL地址写法如下:
- Oracle: `jdbc:oracle:thin:@localhost:1521:sid`
- SqlServer: `jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sid`
- MySql: `jdbc:mysql://localhost:3306/sid`
Mysql的简写形式:`jdbc:mysql:///sid`
常用属性包括:`useUnicode=true&characterEncoding=UTF-8`
URL用于标识数据库位置,程序员通过URL地址告诉JDBC程序连接哪个数据库,URL的写法为:`jdbc:mysql://localhost:3306/test`。
参数格式为:`?参数名=参数值`。
ppt 文件大小:946.5KB