Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean NonQuery(String SQL_Statement, List<String> parameters) throws SQLException {
- PreparedStatement sql_statement = null;
- int index = 1;
- int affecteRows;
- boolean flag = false;
- try {
- //db_connection == null;
- sql_statement = db_connection.prepareStatement(SQL_Statement);
- for (String parameter : parameters) {
- sql_statement.setString(index, parameter);
- index++;
- }
- index = 0;
- affecteRows = sql_statement.executeUpdate();
- if(affecteRows > 0) {
- flag = true;
- }
- System.out.println(affecteRows);
- } catch (SQLException e) {
- System.out.println("Connect is not established with the database");
- System.err.format("SQL State: %sn%s", e.getSQLState(), e.getMessage());
- }
- return flag;
- }
- CREATE TABLE [dbo].[RecordQueue](
- [Id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
- [RecordId] [int] NOT NULL,
- [DocumentDate] [date] NOT NULL,
- [RecordTypeId] [int] NOT NULL,
- [Processed] [bit] NOT NULL,
- [Failed] [bit] NULL,
- [UpdatedDate] [datetime] NULL,
- [PriorityId] [int] NOT NULL,
- CONSTRAINT [PK_RecordQueue] PRIMARY KEY CLUSTERED
- (
- [Id] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- USE DeedsOfficeData
- INSERT INTO RecordQueue (RecordId, DocumentDate, RecordTypeId, Processed, Failed, UpdatedDate, PriorityId)VALUES (244637596, GETDATE(), 4, 0, 0, null, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement