This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
Class.forName("com.mysql.jdbc.Driver"); | |
Connection conn = DriverManager.getConnection("jdbc:mysql:///kaishengit_db", "root", "root"); | |
String sql = "insert into t_test(username,address) values('vv','china')"; | |
Statement stat = conn.createStatement(); | |
stat.execute(sql, Statement.RETURN_GENERATED_KEYS); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//分割 | |
public static void splitFile(String path,int count) { | |
try { | |
RandomAccessFile raf = new RandomAccessFile(path, "r"); | |
//文件总大小 | |
long length = raf.length(); | |
//每份文件大小 | |
long maxSize = length / count; | |
//最后一份文件大小 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Drop file upload</title> | |
<style> | |
#dropdiv{ | |
margin: 40px auto; | |
width: 900px; | |
height: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<span id="nowTime"></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<img src="http://img3.cache.netease.com/ent/2014/8/20/20140820195348e7e34.jpg" alt="成龙就房祖名吸毒道歉:我教子无方 很羞愧" width="310" height="220"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<button id="commit" disabled>提交</button> | |
<input id="checkboxId" type="checkbox" />选中后提交按钮可用 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* <p> | |
* Title: HTML相关的正则表达式工具类 | |
* </p> | |
* <p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS `province`; | |
CREATE TABLE `province` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(50) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=gbk; | |
-- ---------------------------- | |
-- Records of province | |
-- ---------------------------- | |
INSERT INTO `province` VALUES ('1', '北京市'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<span id="nowTime"></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---导入jar包或者使用maven | |
maven | |
<dependency> | |
<groupId>net.sourceforge.jexcelapi</groupId> | |
<artifactId>jxl</artifactId> | |
<version>2.6.12</version> | |
</dependency> | |