All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.code.eforceconfig.jdbc.DBStatement Maven / Gradle / Ivy

The newest version!
package com.google.code.eforceconfig.jdbc;

import java.util.ArrayList;
import java.util.Map;
import java.util.Iterator;

import com.google.code.eforceconfig.SQLStatement;
import com.google.code.eforceconfig.BindVariable;

/**
 * Easy to use java.sql.Statement wrapper
 * that uses eforceconfig to bind variables
 */
public class DBStatement 
{
  private SQLStatement statement;
  private String stmt;
  private ArrayList pars;
  private int hash=0;
  private int updateCount=-1;
  private int addParameterIdx=0;
  private int fetchSize= -1;
  
  public DBStatement(String statement)
  {
    this.stmt= statement;
    pars= new ArrayList();
    updateHashCode();
  }
  
  public DBStatement(String statement, String[] pars)
  {
      if (statement==null||statement.equals("")) 
          throw new RuntimeException("Invalid empty statement string");
      
      this.stmt= statement;
      
      this.pars= new ArrayList(pars.length);
      
      for (int i=0;i=s)
      {
        for (int i=s;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy