Signed-off-by: lixiangrong <lixiangrong@pxene.com>
This commit is contained in:
		
							
								
								
									
										10
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -149,6 +149,16 @@ | ||||
| 			<artifactId>httpclient</artifactId> | ||||
| 			<version>4.5.2</version> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<groupId>org.apache.cxf</groupId> | ||||
| 			<artifactId>cxf-rt-frontend-jaxws</artifactId> | ||||
| 			<version>3.1.6</version> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<groupId>org.apache.cxf</groupId> | ||||
| 			<artifactId>cxf-rt-transports-http</artifactId> | ||||
| 			<version>3.1.6</version> | ||||
| 		</dependency> | ||||
| 	</dependencies> | ||||
| 	<build> | ||||
| 		<finalName>useful-code</finalName> | ||||
|   | ||||
| @@ -3,7 +3,7 @@ redis.pool.maxIdle=200 | ||||
| redis.pool.maxWait=1000 | ||||
| redis.pool.testOnBorrow=true | ||||
| redis.pool.testOnReturn=true | ||||
| redis.ip=192.168.3.166 | ||||
| #redis.ip=111.235.158.31 | ||||
| #redis.ip=192.168.3.166 | ||||
| redis.ip=111.235.158.31 | ||||
| redis.port=7379 | ||||
| redis.password= | ||||
| @@ -7,9 +7,11 @@ import java.sql.ResultSet; | ||||
| import java.sql.ResultSetMetaData; | ||||
| import java.sql.SQLException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
|  | ||||
| import net.sf.json.JSONObject; | ||||
| import osc.git.eh3.redis.JedisUtil; | ||||
| @@ -17,7 +19,7 @@ import osc.git.eh3.redis.JedisUtil; | ||||
| public class TestJdbc { | ||||
| 	private static Connection getConn() { | ||||
| 		String driver = "com.mysql.jdbc.Driver"; | ||||
| 		String url = "jdbc:mysql://192.168.3.166:3306/wins-dsp-new?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&connectTimeout=60000&socketTimeout=60000"; | ||||
| 		String url = "jdbc:mysql://192.168.3.11:3306/wins-dsp-new?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&connectTimeout=60000&socketTimeout=60000"; | ||||
| 		String username = "root"; | ||||
| 		String password = "pxene"; | ||||
| 		Connection conn = null; | ||||
| @@ -80,8 +82,11 @@ public class TestJdbc { | ||||
| 	} | ||||
|  | ||||
| 	public static void main(String[] args) { | ||||
| 		 | ||||
| 		insertData(); | ||||
| 		 | ||||
| 		// getAll(); | ||||
| 		 JedisUtil.deleteByPattern("HistoryAPPData_*"); | ||||
| //		 JedisUtil.deleteByPattern("HistoryAPPData_*"); | ||||
| 		/* | ||||
| 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||||
| 		Date start = new Date(); | ||||
| @@ -128,4 +133,21 @@ public class TestJdbc { | ||||
| 		} | ||||
| 		return mapids; | ||||
| 	} | ||||
|  | ||||
| 	private static void insertData(){ | ||||
| 		Connection conn = getConn(); | ||||
| 		System.out.println(new Date()); | ||||
| 		for (int i = 0; i > -1; i++) { | ||||
| 			String cid = UUID.randomUUID().toString(); | ||||
| 			String sql = "INSERT INTO `dsp_t_statis_by_day` (`time`, `creativeid`, `category`, `imprs`, `clks`, `cost`, `downloads`, `regists`, `flag`, `createtime`) VALUES ('2014-12-06 00:00:00', '"+cid+"', '2', '961', '9', '201860.7000', '0', '0', '0', '2015-09-14 15:07:42');"; | ||||
| 			PreparedStatement pstmt; | ||||
| 			try { | ||||
| 				pstmt = (PreparedStatement) conn.prepareStatement(sql); | ||||
| 				pstmt.executeUpdate(); | ||||
| 			} catch (SQLException e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 		System.out.println(new Date()); | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										57
									
								
								src/main/java/osc/git/eh3/test/TestJdbc2.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								src/main/java/osc/git/eh3/test/TestJdbc2.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | ||||
| package osc.git.eh3.test; | ||||
|  | ||||
| import java.sql.Connection; | ||||
| import java.sql.DriverManager; | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.ResultSetMetaData; | ||||
| import java.sql.SQLException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
|  | ||||
| import net.sf.json.JSONObject; | ||||
| import osc.git.eh3.redis.JedisUtil; | ||||
|  | ||||
| public class TestJdbc2 { | ||||
| 	private static Connection getConn() { | ||||
| 		String driver = "com.mysql.jdbc.Driver"; | ||||
| 		String url = "jdbc:mysql://192.168.3.11:3306/wins-dsp-new?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&connectTimeout=60000&socketTimeout=60000"; | ||||
| 		String username = "root"; | ||||
| 		String password = "pxene"; | ||||
| 		Connection conn = null; | ||||
| 		try { | ||||
| 			Class.forName(driver); // classLoader,加载对应驱动 | ||||
| 			conn = (Connection) DriverManager.getConnection(url, username, password); | ||||
| 		} catch (ClassNotFoundException e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} catch (SQLException e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 		return conn; | ||||
| 	} | ||||
|  | ||||
| 	public static void main(String[] args) { | ||||
| 		insertData(); | ||||
| 	} | ||||
|  | ||||
| 	private static void insertData(){ | ||||
| 		Connection conn = getConn(); | ||||
| 		System.out.println(new Date()); | ||||
| 		for (int i = 0; i > -1; i++) { | ||||
| 			String cid = UUID.randomUUID().toString(); | ||||
| 			String sql = "INSERT INTO `dsp_t_statis_by_day` (`time`, `creativeid`, `category`, `imprs`, `clks`, `cost`, `downloads`, `regists`, `flag`, `createtime`) VALUES ('2014-12-06 00:00:00', '"+cid+"', '2', '961', '9', '201860.7000', '0', '0', '0', '2015-09-14 15:07:42');"; | ||||
| 			PreparedStatement pstmt; | ||||
| 			try { | ||||
| 				pstmt = (PreparedStatement) conn.prepareStatement(sql); | ||||
| 				pstmt.executeUpdate(); | ||||
| 			} catch (SQLException e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 		System.out.println(new Date()); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										57
									
								
								src/main/java/osc/git/eh3/test/TestJdbc3.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								src/main/java/osc/git/eh3/test/TestJdbc3.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | ||||
| package osc.git.eh3.test; | ||||
|  | ||||
| import java.sql.Connection; | ||||
| import java.sql.DriverManager; | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.ResultSetMetaData; | ||||
| import java.sql.SQLException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
|  | ||||
| import net.sf.json.JSONObject; | ||||
| import osc.git.eh3.redis.JedisUtil; | ||||
|  | ||||
| public class TestJdbc3 { | ||||
| 	private static Connection getConn() { | ||||
| 		String driver = "com.mysql.jdbc.Driver"; | ||||
| 		String url = "jdbc:mysql://115.182.33.143:3306/wins-dsp-new?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&connectTimeout=60000&socketTimeout=60000"; | ||||
| 		String username = "root"; | ||||
| 		String password = "pxene"; | ||||
| 		Connection conn = null; | ||||
| 		try { | ||||
| 			Class.forName(driver); // classLoader,加载对应驱动 | ||||
| 			conn = (Connection) DriverManager.getConnection(url, username, password); | ||||
| 		} catch (ClassNotFoundException e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} catch (SQLException e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 		return conn; | ||||
| 	} | ||||
|  | ||||
| 	public static void main(String[] args) { | ||||
| 		insertData(); | ||||
| 	} | ||||
|  | ||||
| 	private static void insertData(){ | ||||
| 		Connection conn = getConn(); | ||||
| 		System.out.println(new Date()); | ||||
| 		for (int i = 0; i > -1; i++) { | ||||
| 			String cid = UUID.randomUUID().toString(); | ||||
| 			String sql = "INSERT INTO `dsp_t_statis_by_day` (`time`, `creativeid`, `category`, `imprs`, `clks`, `cost`, `downloads`, `regists`, `flag`, `createtime`) VALUES ('2014-12-06 00:00:00', '"+cid+"', '2', '961', '9', '201860.7000', '0', '0', '0', '2015-09-14 15:07:42');"; | ||||
| 			PreparedStatement pstmt; | ||||
| 			try { | ||||
| 				pstmt = (PreparedStatement) conn.prepareStatement(sql); | ||||
| 				pstmt.executeUpdate(); | ||||
| 			} catch (SQLException e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 		System.out.println(new Date()); | ||||
| 	} | ||||
| } | ||||
| @@ -9,7 +9,7 @@ public class TestRedisData { | ||||
| 	 | ||||
| 	 | ||||
| 	public static void main(String[] args) throws IOException { | ||||
| 		showSom("fa5f9738-6055-4881-b1be-32f8111a18d1"); | ||||
| 		showSom("27ef277d-25e7-4347-b07f-9668a8a802cd"); | ||||
| 	} | ||||
|  | ||||
| 	public static void showSom(String groupid){ | ||||
|   | ||||
							
								
								
									
										14
									
								
								src/main/java/osc/git/eh3/test/TestWS.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/main/java/osc/git/eh3/test/TestWS.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| package osc.git.eh3.test; | ||||
|  | ||||
| import com.dxpmedia.hdtsspapitest.CreativeService; | ||||
| import com.dxpmedia.hdtsspapitest.CreativeServiceSoap; | ||||
|  | ||||
| public class TestWS { | ||||
|  | ||||
| 	public static void main(String[] args) { | ||||
| 		CreativeService service = new CreativeService(); | ||||
| 		CreativeServiceSoap serviceSoap = service.getCreativeServiceSoap(); | ||||
| 		String result = serviceSoap.creativeSubmit("0", "1",2); | ||||
| 		System.out.println(result); | ||||
| 	} | ||||
| } | ||||
| @@ -25,8 +25,7 @@ | ||||
|             <property name="enableSubPackages" value="true"/>   | ||||
|         </javaClientGenerator>   | ||||
|                 | ||||
|         <table tableName="dsp_t_coordinate" domainObjectName="CoordinateModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table> | ||||
|         <table tableName="dsp_t_group_coordinate" domainObjectName="GroupCoordinateModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table> | ||||
|         <table tableName="dsp_t_geohash_precision" domainObjectName="GeohashPrecisionModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table> | ||||
|     </context>   | ||||
|  | ||||
| </generatorConfiguration>   | ||||
		Reference in New Issue
	
	Block a user