@@ -100,24 +100,19 @@ public String getColumnType(Connection conn, String tableName, String columnName
100100 }
101101
102102 public void addColumn (Connection conn , String tableName , String columnName , String columnDefinition ) {
103- System .out .println ("------------------------" + String .format ("ALTER TABLE %s ADD COLUMN %s %s" , tableName , columnName , columnDefinition ));
104103 try (PreparedStatement pstmt = conn .prepareStatement (String .format ("ALTER TABLE %s ADD COLUMN %s %s" , tableName , columnName , columnDefinition ));){
105104 pstmt .executeUpdate ();
106- System .out .println ("column added------------------------" + String .format ("ALTER TABLE %s ADD COLUMN %s %s" , tableName , columnName , columnDefinition ));
107105 logger .debug ("Column {} is added successfully from the table {}" , columnName , tableName );
108106 } catch (SQLException e ) {
109- System .out .println ("column not added------------------------" + e .getMessage ());
110107 logger .warn ("Unable to add column {} to table {} due to exception" , columnName , tableName , e );
111108 }
112109 }
113110
114111 public void changeColumn (Connection conn , String tableName , String oldColumnName , String newColumnName , String columnDefinition ) {
115112 try (PreparedStatement pstmt = conn .prepareStatement (String .format ("ALTER TABLE %s CHANGE COLUMN %s %s %s" , tableName , oldColumnName , newColumnName , columnDefinition ));){
116113 pstmt .executeUpdate ();
117- System .out .println ("column changed------------------------" + String .format ("ALTER TABLE %s CHANGE COLUMN %s %s %s" , tableName , oldColumnName , newColumnName , columnDefinition ));
118114 logger .debug ("Column {} is changed successfully to {} from the table {}" , oldColumnName , newColumnName , tableName );
119115 } catch (SQLException e ) {
120- System .out .println ("column not changed------------------------" + e .getMessage ());
121116 logger .warn ("Unable to add column {} to {} from the table {} due to exception" , oldColumnName , newColumnName , tableName , e );
122117 }
123118 }
0 commit comments