资源简介
fp-growths算法的java源码,喜欢就请下载
代码片段和文件信息
package association.fptree;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* 连接数据库
*/
public class ConnDB {
protected Connection connection;
protected Statement statement;
static ResultSet rs=null;
public void Connect(){};
public Connection getConn(){
return connection;
}
public void disconnect(){
try{
if (rs!=null)
rs.close();
if (statement!=null)
statement.close();
if (connection!=null)
connection.close();
}
catch(SQLException e){}
}
}
//用JDBC连接SQL Server数据库
class SQLDB extends ConnDB{
public void Connect(){
Connect(“““““foodmart“);
}
public void Connect(String DBName){
Connect(““““DBName);
}
public void Connect(String userString pwString DBName){
String username;
String password;
try {
Class.forName(“com.microsoft.jdbc.sqlserver.SQLServerDriver“).newInstance();
}
catch (Exception e) {
System.out.println(
“Unable to register the JDBC Driver.\n“ +
“Make sure the JDBC driver is in the\n“ +
“classpath.\n“);
System.exit(1);
}
String url=“jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=“+DBName;
username = “sa“;
password = “990414“;
try {
connection = DriverManager.getConnection(url username password);
statement=connection.createStatement();
}
catch (SQLException e) {
System.out.println(
“Unable to make a connection to the database.\n“ +
“The reason: “ + e.getMessage());
System.exit(1);
return;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 21084 2006-08-27 13:18 fpgrowth\fpgrowth.jar
文件 256242 2006-08-27 13:19 fpgrowth\sample.txt
文件 56 2006-08-27 14:15 fpgrowth\test.bat
文件 230 2006-08-27 13:43 fpgrowth\about.txt
文件 9045 2006-08-27 13:01 fpgrowth\source\fptree\CreateFPTree.java
文件 1837 2005-10-21 16:24 fpgrowth\source\fptree\ConnDB.java
文件 3509 2006-08-27 13:01 fpgrowth\source\fptree\FPTree.java
文件 1672 2006-08-27 13:10 fpgrowth\source\fptree\FPGrowth.java
文件 3122 2005-11-07 15:23 fpgrowth\source\fptree\Algorithm Desc
文件 1102 2006-08-27 13:09 fpgrowth\source\fptree\Print.java
文件 1306 2005-11-24 21:35 fpgrowth\source\fptree\Stack.java
文件 3032 2006-08-27 11:46 fpgrowth\source\fptree\Sort.java
文件 241 2005-11-22 19:10 fpgrowth\source\fptree\Item.java
文件 286 2005-11-21 11:03 fpgrowth\source\fptree\MyException.java
文件 4143 2006-08-27 13:09 fpgrowth\source\fptree\ITree.java
文件 412 2005-11-24 21:36 fpgrowth\source\fptree\StackTest.java
文件 972 2006-08-27 12:43 fpgrowth\source\fptree\Queue.java
文件 1084 2006-08-27 13:17 fpgrowth\source\fptree\Test.java
目录 0 2006-08-28 07:58 fpgrowth\source\fptree
目录 0 2006-08-28 07:58 fpgrowth\source
目录 0 2006-08-28 07:58 fpgrowth
----------- --------- ---------- ----- ----
309375 21
- 上一篇:Java实现圆圈旋转效果,等待、加载、刷新、旋转进度条
- 下一篇:Java拼写检查
评论
共有 条评论