http://tech.ccidnet.com/pub/article/c1110_a173155_p1.html
解决方案 »
- 关于lucene 问题 懂的大神们进
- spring配置数据源
- TreeSet取值问题?
- Struts标签嵌套的问题
- hibernate在mssql中查询中的问题?
- 在applet中怎么获得cookie?
- 能否在ie客户端判断该pc是否安装了PDF?
- Exception in thread "main" java.lang.NoClassDefFoudError:wxf/Mail
- jboss中的部署问题,如果我不想将web应用或者ejb放到jboss默认的部署目录下,我该如何做
- EJB2.0查询的问题?
- jsp 连 sql server 的问题
- 请问org.apache.commons.net.tftp包在哪下载?
public final Connection myConn(String serverType) throws SQLException,
InstantiationException, IllegalAccessException,
ClassNotFoundException {
Connection conn = null;
String driver = new String();
String connString = new String();
driver = "com.mysql.jdbc.Driver";
connString = "jdbc:mysql://localhost/dreamsite?user=root&password=";
if (serverType.equals("sqlserver")) {
driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
} Class.forName(driver).newInstance();
conn = DriverManager
.getConnection("jdbc:mysql://localhost/dreamsite?user=root&password="); if (serverType.equals("sqlserver")) {
connString = "jdbc:microsoft:sqlserver://192.168.2.100:1433;databaseName=video";
String databaseName = "sa";
String password = "123456"; conn = DriverManager.getConnection(connString, databaseName,
password); }
return conn;
}