Home > Database > Mysql Tutorial > mysql-请问:我这个代码怎修改,实现excel导入到MySQL中?谢谢

mysql-请问:我这个代码怎修改,实现excel导入到MySQL中?谢谢

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 09:39:07
Original
859 people have browsed it

mysqlexcel数据库class

/**

  • 导入表时的选择器
  • @author yangenxiong
    *
    */
    class importTableChooser extends JFileChooser {

    private MainFrame mainFrame;

    private Database db;

    public importTableChooser(MainFrame mainFrame, Database db) {
    this.mainFrame = mainFrame;
    this.db = db;
    this.setFileSelectionMode(DIRECTORIES_ONLY);
    }

    public void approveSelection() {
    File file = this.getSelectedFile();
    if (file.isDirectory()) {
    //用户选择了目录
    File targetFile = new File(file.getAbsolutePath() + File.separator +
    this.db.getDatabaseName() + ".xls");
    this.mainFrame.importTable();
    } else {
    this.mainFrame.importTable();
    }
    super.approveSelection();
    }
    }

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template