标签:cat span vat == cal name localhost 视频下载 content
5.SQLServer DataSource and SingleTon:(视频下载) (全部书籍)
import net.sourceforge.jtds.jdbcx.*;
import java.sql.*;
import javax.sql.*;
public class SqlserverSingletonDataSource {
static private JtdsDataSource ds;
private Connection con;
private SqlserverSingletonDataSource() {
try {
ds = new JtdsDataSource();
ds.setServerName("localhost");
ds.setDatabaseName("pubs");
ds.setUser("sa");
ds.setPassword("");
}
catch (Exception e) {
}
}
public static Connection getConnection() throws Exception {
if (ds == null) {
new SqlserverSingletonDataSource();
}
Connection con =null;
try {
详情请见:
给出一个SQLServer DataSource 数据源单态模式的例子?
标签:cat span vat == cal name localhost 视频下载 content
原文地址:https://www.cnblogs.com/mark-to-win/p/9708729.html