Compare commits
No commits in common. "master" and "testCode" have entirely different histories.
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
|
@ -0,0 +1 @@
|
|||
target
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>jenkins_test</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
15
Example.java
15
Example.java
|
|
@ -1,15 +0,0 @@
|
|||
public class Example{
|
||||
int str=1;
|
||||
char[]ch={'a','b'};
|
||||
public static void main(String args[]){
|
||||
Example ex=new Example();
|
||||
ex.change(ex.str,ex.ch);
|
||||
|
||||
System.out.print(ex.ch);
|
||||
System.out.print(ex.str+" and "+"\n\r");
|
||||
}
|
||||
public void change(int a,char ch[]){
|
||||
a=2;
|
||||
ch[0]='c';
|
||||
}
|
||||
}
|
||||
BIN
Example2.class
BIN
Example2.class
Binary file not shown.
|
|
@ -1,17 +0,0 @@
|
|||
public class Example2{
|
||||
int str=1;
|
||||
char[]ch={'a','b'};
|
||||
public static void main(String args[]){
|
||||
System.out.print(" 1111111111111 "+"\n\r");
|
||||
try {
|
||||
Thread.sleep(1000*10);
|
||||
} catch (Exception e) {
|
||||
System.out.print("MYSQL ERROR:" + e.getMessage());
|
||||
}
|
||||
System.out.print(" 22222222222 "+"\n\r");
|
||||
}
|
||||
public void change(int a,char ch[]){
|
||||
a=2;
|
||||
ch[0]='c';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
|
||||
/**
|
||||
* 文件名 : JdbcTest.java
|
||||
* 版权 : <版权/公司名>
|
||||
* 描述 : <描述>
|
||||
* @author liliy
|
||||
* 版本 : <版本>
|
||||
* 修改时间: 2017年3月12日
|
||||
* 修改内容: <修改内容>
|
||||
*/
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
|
||||
/**
|
||||
* <一句话功能简述>
|
||||
* <功能详细描述>
|
||||
* @author liliy
|
||||
* @version [版本号,2017年3月12日]
|
||||
* @see [相关类/方法]
|
||||
* @since [产品/模块版本]
|
||||
*/
|
||||
|
||||
public class JdbcTest {
|
||||
public static void main(String arg[]) {
|
||||
try {
|
||||
//System.out.print("sleep now");
|
||||
//Thread.sleep(1000*10);
|
||||
String url = "jdbc:mysql://127.0.0.1:3306/mysql?"
|
||||
+ "user=root&password=123123&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&failOverReadOnly=false&useSSL=false";
|
||||
Connection con = null; //定义一个MYSQL链接对象
|
||||
Class.forName("com.mysql.jdbc.Driver");// 动态加载mysql驱动
|
||||
con = DriverManager.getConnection(url); //链接本地MYSQL
|
||||
|
||||
Statement stmt; //创建声明
|
||||
stmt = con.createStatement();
|
||||
String selectSql = "SELECT * FROM user";
|
||||
ResultSet selectRes = stmt.executeQuery(selectSql);
|
||||
while (selectRes.next()) { //循环输出结果集
|
||||
String username = selectRes.getString("User");
|
||||
System.out.print("\r\n\r\n");
|
||||
System.out.print("username:" + username );
|
||||
}
|
||||
// PreparedStatement pstmt = (PreparedStatement) con.prepareStatement("GRANT USAGE ON *.* TO 'user01'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;");
|
||||
stmt.execute("GRANT USAGE ON *.* TO 'user01'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;");
|
||||
stmt.close();
|
||||
con.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.print("MYSQL ERROR:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
4
exec.sh
4
exec.sh
|
|
@ -1,4 +0,0 @@
|
|||
javac Example.java
|
||||
java Example
|
||||
javac -cp .:mysql-connector-java-5.1.38.jar JdbcTest.java
|
||||
java -cp .:mysql-connector-java-5.1.38.jar JdbcTest
|
||||
Binary file not shown.
|
|
@ -0,0 +1,25 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>springmvc</groupId>
|
||||
<artifactId>jenkins_test</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jenkins_test</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package springmvc.jenkins_test;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package springmvc.jenkins_test;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue