D:\JavaFrameworks\InsuranceFramework\src\java\db_adapter\Modify.java |
1
2
3
4
5
6 package db_adapter;
7
8
9
10 @author
11
12 import java.io.*;
13 import java.sql.Connection;
14 import java.sql.DriverManager;
15 import java.sql.PreparedStatement;
16 import java.sql.ResultSet;
17 import java.sql.SQLException;
18 import java.util.ArrayList;
19 import java.util.Hashtable;
20 import java.util.MissingResourceException;
21 import java.util.ResourceBundle;
22 import java.util.Calendar;
23 import java.util.Date;
24 import java.text.SimpleDateFormat;
25
26
27
28 import utils.*;
29 import constants.*;
30
31 public class Modify
32 {
33 Connection localConnection = null;
34
35 public Modify()
36 {
37 BD_Connector localBD_Connector = new BD_Connector();
38 localConnection = localBD_Connector.getConnection();
39 }
40
41
42
43 public int alterModifyColumns(String passedTableName_1)
44 {
45 if(null == localConnection)
46 return(Constants.ERROR_RUN);
47 PreparedStatement localPreparedStatement = null;
48
49 try
50 {
51
52
53
54
55
56
57
58
59
60
61 String qryString = "";
62 String tableName_1 = DatabaseKeysPropertyManager.getParameter(passedTableName_1);
63
64 qryString = "ALTER TABLE "
65 + tableName_1
66 + " MODIFY "
67 + " (supplier_name varchar2(100) not null,"
68 + " city varchar2(75)"
69 + ");";
70 localPreparedStatement = localConnection.prepareStatement(qryString);
71 localPreparedStatement.executeQuery();
72 localPreparedStatement.close();
73 }
74 catch(MissingResourceException eMissingResourceException)
75 {
76 eMissingResourceException.printStackTrace();
77 return(Constants.ERROR_RUN);
78 }
79 catch(SQLException eSQLException)
80 {
81 eSQLException.printStackTrace();
82 return(Constants.ERROR_RUN);
83 }
84 return(Constants.NORMAL_RUN);
85 }
86 }
87
88