• 大小: 99KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-15
  • 语言: Java
  • 标签: fptree  java  源代码  

资源简介

fpgrowth算法的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;
     }
    
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      25070  2006-09-23 22:04  fpgrowth\fpgrowth.jar

     文件     256242  2006-08-27 13:19  fpgrowth\sample1.txt

     文件         65  2006-09-23 22:04  fpgrowth\test.bat

     文件        287  2006-09-23 22:06  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 Description

     文件       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

     文件       4205  2006-09-23 21:50  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

     文件       1128  2006-09-23 22:05  fpgrowth\source\fptree\Test.java

     目录          0  2006-08-27 13:44  fpgrowth\source\fptree

     目录          0  2006-08-27 13:43  fpgrowth\source

     文件        114  2006-09-23 21:26  fpgrowth\sample.txt

     目录          0  2006-08-27 13:38  fpgrowth

----------- ---------  ---------- -----  ----

               313647                    22


评论

共有 条评论