URL: http://www.v2ex.com/api/site/stats.json
获取社区统计信息。
| 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', '北京市'); |
| package com.kaishengit.db.RowMapper; | |
| import java.sql.ResultSet; | |
| import java.sql.ResultSetMetaData; | |
| import java.sql.SQLException; | |
| import com.kaishengit.util.BeanUtil; | |
| public class BeanPropertyRowMapper<T> implements RowMapper<T>{ |
URL: http://www.v2ex.com/api/site/stats.json
获取社区统计信息。
| package com.kaishengit.util; | |
| import java.lang.reflect.Method; | |
| import java.util.Map; | |
| import java.util.Map.Entry; | |
| public class Servlets { | |
| //map 模拟request.getParamterNames() | |
| public static <T> T setObjectValue(Class<T> clazz, |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Drop file upload</title> | |
| <style> | |
| #dropdiv{ | |
| margin: 40px auto; | |
| width: 900px; | |
| height: 400px; |
| package com.kaishengit.util; | |
| import java.io.Serializable; | |
| import net.sf.ehcache.CacheManager; | |
| import net.sf.ehcache.Ehcache; | |
| import net.sf.ehcache.Element; | |
| public class CacheHelp { |
| package com.kaishengit.filter; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStreamWriter; | |
| import java.io.PrintWriter; | |
| import java.util.zip.GZIPOutputStream; | |
| import javax.servlet.Filter; | |
| import javax.servlet.FilterChain; |
| QueryRunner runner = new QueryRunner(dataSource); | |
| String sql = "select id from t_user"; | |
| List<Integer> list = runner.query(sql, new ColumnListHandler<Integer>()); |
| <head> | |
| <meta name="menu" content="chedui"> | |
| </head> | |
| <body> | |
| </body> |
| package com.kaishengit.bbs; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.client.ClientProtocolException; | |
| import org.apache.http.client.methods.HttpGet; | |
| import org.apache.http.impl.client.DefaultHttpClient; |