주소 구축 수정

main
이범준 3 weeks ago
parent de88ef62c2
commit 6cab4a9c41

@ -13,5 +13,6 @@ public class EstablishJusoRequest extends AbstractEntity {
private String dbPassword; private String dbPassword;
private String tableSpace; private String tableSpace;
private String tableName; private String tableName;
private String colNames;
} }

@ -29,12 +29,18 @@ public class EstablishJusoThread implements Runnable {
BufferedReader reader = null; BufferedReader reader = null;
StringBuffer strSQL = new StringBuffer(); StringBuffer strSQL = new StringBuffer();
strSQL.append("INSERT INTO "+vo.getTableSpace()+"."+vo.getTableName() strSQL.append("INSERT INTO "+vo.getTableSpace()+"."+vo.getTableName());
+" VALUES (?,?,?,?,?,?,?,?,?,?," if(vo.getColNames() != null && !vo.getColNames().equals("")) {
strSQL.append(" ("+vo.getColNames()+")");
}
strSQL.append(" VALUES (?,?,?,?,?,?,?,?,?,?,"
+"?,?,?,?,?,?,?,?,?,?," +"?,?,?,?,?,?,?,?,?,?,"
+"?,?,?,?,?,?,?,?,?,?," +"?,?,?,?,?,?,?,?,?,?,"
+"?,?)"); +"?");
if(vo.getColNames() == null || vo.getColNames().equals("")) {
strSQL.append(",?");
}
strSQL.append(")");
Connection conn = null; Connection conn = null;
try { try {
@ -51,7 +57,10 @@ public class EstablishJusoThread implements Runnable {
ps.setString(j+1, params[j]); ps.setString(j+1, params[j]);
} }
ps.setDate(32, new java.sql.Date(new java.util.Date().getTime())); if(vo.getColNames() == null || vo.getColNames().equals("")) {
ps.setDate(32, new java.sql.Date(new java.util.Date().getTime()));
}
ps.executeUpdate(); ps.executeUpdate();
conn.commit(); conn.commit();
} }

@ -24,6 +24,10 @@
<br/> <br/>
테이블명<input type="text" name="tableName" /> 테이블명<input type="text" name="tableName" />
<br/> <br/>
컬럼명목록(선택)
<br/>
<textarea name="colNames" rows="10" cols="" style="width: 100%"></textarea>
<br/>
</form> </form>
<button type="button" id="btnEstablishJuso--${pageName}">주소구축</button> <button type="button" id="btnEstablishJuso--${pageName}">주소구축</button>
@ -32,10 +36,12 @@
<datalist id="driverList--${pageName}"> <datalist id="driverList--${pageName}">
<option>com.tmax.tibero.jdbc.TbDriver</option> <option>com.tmax.tibero.jdbc.TbDriver</option>
<option>net.sf.log4jdbc.sql.jdbcapi.DriverSpy</option>
</datalist> </datalist>
<datalist id="dbConnList--${pageName}"> <datalist id="dbConnList--${pageName}">
<option>jdbc:tibero:thin:@211.119.124.22:8629:tibero</option> <option>jdbc:tibero:thin:@211.119.124.22:8629:tibero</option>
<option>jdbc:log4jdbc:mariadb://211.119.124.122:53306/electricparking_jejusi</option>
</datalist> </datalist>
<script> <script>

Loading…
Cancel
Save