标签:ati jdbc .sql ber 基本 jdb sqlserver exce property
JDBC基本用法
jdbc.driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test
jdbc.username=root
jdbc.password=root
public static Connection getConnection() throws IOException, ClassNotFoundException, SQLException { Properties props = new Properties(); props.load(new FileInputStream("jdbc.properties")); Class.forName(props.getProperty("jdbc.driverClass")); String url = props.getProperty("jdbc.url"); String username = props.getProperty("jdbc.username"); String password = props.getProperty("jdbc.password"); return DriverManager.getConnection(url, username, password); }
DBCP
Spring
JPA
Hibernate
标签:ati jdbc .sql ber 基本 jdb sqlserver exce property
原文地址:http://www.cnblogs.com/anxiao/p/7340574.html