准备编写清理函数
This commit is contained in:
		@@ -136,20 +136,18 @@
 | 
			
		||||
  </dependencies>
 | 
			
		||||
 | 
			
		||||
  <build>
 | 
			
		||||
    <!-- <defaultGoal>compile</defaultGoal> -->
 | 
			
		||||
    <!-- lock down plugins versions to avoid using Maven defaults (may be moved to
 | 
			
		||||
      parent pom) -->
 | 
			
		||||
    <defaultGoal>compile</defaultGoal>
 | 
			
		||||
    <plugins>
 | 
			
		||||
      <plugin>
 | 
			
		||||
        <artifactId>maven-surefire-plugin</artifactId>
 | 
			
		||||
        <version>3.3.0</version>
 | 
			
		||||
        <version>3.5.2</version>
 | 
			
		||||
        <configuration>
 | 
			
		||||
          <skip>true</skip>
 | 
			
		||||
        </configuration>
 | 
			
		||||
      </plugin>
 | 
			
		||||
      <plugin>
 | 
			
		||||
        <artifactId>maven-compiler-plugin</artifactId>
 | 
			
		||||
        <version>3.13.0</version>
 | 
			
		||||
        <version>3.14.0</version>
 | 
			
		||||
        <configuration>
 | 
			
		||||
          <compilerArguments>
 | 
			
		||||
            <extdirs>${project.basedir}/lib</extdirs>
 | 
			
		||||
@@ -159,7 +157,7 @@
 | 
			
		||||
      <plugin>
 | 
			
		||||
        <groupId>org.apache.maven.plugins</groupId>
 | 
			
		||||
        <artifactId>maven-assembly-plugin</artifactId>
 | 
			
		||||
        <version>3.3.0</version>
 | 
			
		||||
        <version>3.7.1</version>
 | 
			
		||||
        <configuration>
 | 
			
		||||
          <descriptorRefs>
 | 
			
		||||
            <descriptorRef>jar-with-dependencies</descriptorRef>
 | 
			
		||||
@@ -181,22 +179,22 @@
 | 
			
		||||
        </executions>
 | 
			
		||||
      </plugin>
 | 
			
		||||
      <plugin>
 | 
			
		||||
            <groupId>org.springframework.boot</groupId>
 | 
			
		||||
            <artifactId>spring-boot-maven-plugin</artifactId>
 | 
			
		||||
            <version>3.4.3</version>
 | 
			
		||||
            <configuration>
 | 
			
		||||
                <mainClass>com.cpic.xim.huixiabao.AppMain</mainClass>
 | 
			
		||||
                <includeSystemScope>true</includeSystemScope>
 | 
			
		||||
            </configuration>
 | 
			
		||||
            <executions>
 | 
			
		||||
                <execution>
 | 
			
		||||
                    <id>repackage</id>
 | 
			
		||||
                    <goals>
 | 
			
		||||
                        <goal>repackage</goal>
 | 
			
		||||
                    </goals>
 | 
			
		||||
                </execution>
 | 
			
		||||
            </executions>
 | 
			
		||||
        </plugin>
 | 
			
		||||
        <groupId>org.springframework.boot</groupId>
 | 
			
		||||
        <artifactId>spring-boot-maven-plugin</artifactId>
 | 
			
		||||
        <version>3.4.3</version>
 | 
			
		||||
        <configuration>
 | 
			
		||||
          <mainClass>com.cpic.xim.huixiabao.AppMain</mainClass>
 | 
			
		||||
          <includeSystemScope>true</includeSystemScope>
 | 
			
		||||
        </configuration>
 | 
			
		||||
        <executions>
 | 
			
		||||
          <execution>
 | 
			
		||||
            <id>repackage</id>
 | 
			
		||||
            <goals>
 | 
			
		||||
              <goal>repackage</goal>
 | 
			
		||||
            </goals>
 | 
			
		||||
          </execution>
 | 
			
		||||
        </executions>
 | 
			
		||||
      </plugin>
 | 
			
		||||
    </plugins>
 | 
			
		||||
  </build>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -112,7 +112,61 @@ public class CpicximToXMNHS
 | 
			
		||||
 | 
			
		||||
    public static void removePostedHmbXyxInfo( Vector<HmbXyxInfo> postedItems )
 | 
			
		||||
    {
 | 
			
		||||
        Vector<HmbXyxInfo> items = new Vector<HmbXyxInfo>();
 | 
			
		||||
        HmbXyxInfo         item  = null;
 | 
			
		||||
 | 
			
		||||
        Connection connection = null;
 | 
			
		||||
        Statement  statement  = null;
 | 
			
		||||
        ResultSet  result     = null;
 | 
			
		||||
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            Class.forName( "com.mysql.cj.jdbc.Driver" );
 | 
			
		||||
 | 
			
		||||
            String url        = CpicximToXMNHS.url;
 | 
			
		||||
            String userName   = CpicximToXMNHS.userName;
 | 
			
		||||
            String password   = CpicximToXMNHS.password;
 | 
			
		||||
            String sql        = """
 | 
			
		||||
                    delete from HmbXyxInfo_Update where  xyxNo = ?""";
 | 
			
		||||
 | 
			
		||||
            connection = DriverManager.getConnection( url, userName, password );
 | 
			
		||||
            statement  = connection.prepareStatement(sql.trim());
 | 
			
		||||
 | 
			
		||||
            for ( HmbXyxInfo info : postedItems)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        catch ( SQLException error )
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                connection.rollback();
 | 
			
		||||
            }
 | 
			
		||||
            catch ( SQLException e )
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            error.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
        catch ( ClassNotFoundException error )
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        finally
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                
 | 
			
		||||
                statement.close();
 | 
			
		||||
                connection.close();
 | 
			
		||||
            }
 | 
			
		||||
            catch ( SQLException error )
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void postHmbList( Vector<HmbXyxInfo> items )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user