日期:2014-05-16  浏览次数:20492 次

连接数据库的配置语句

我常用的数据库,记录下它们的连接语句,因为有时候会忘了!

?

MySql:

<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/databaseName</property>
<property name="connection.username">root</property>
<property name="connection.password">123</property>

?

Oracle:

<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:databaseName</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>