예제 #1
0
        /**
         *
         * Constructs a new tinySQLStatement object.
         * @param conn the tinySQLConnection object
         *
         */
        public TinySQLPreparedStatement(TinySQLConnection conn, String inputString)
        {
            int nextQuestionMark, startAt;

            connection      = conn;
            startAt         = 0;
            statementString = inputString;
            while ((nextQuestionMark = statementString.indexOf("?", startAt)) > -1)
            {
                if (substitute == (java.util.Vector <Object>)null)
                {
                    substitute = new java.util.Vector <Object>();
                }
                substitute.addElement("");
                startAt = nextQuestionMark + 1;
            }
            invalidIndex = " is not in the range 1 to "
                           + java.lang.Integer.toString(substitute.size());
            if (debug)
            {
                java.lang.SystemJ.outJ.println("Prepare statement has " + substitute.size()
                                               + " parameters.");
            }

            this.setPoolable(true); //Basties note: see Java documentation java.sql.SQLStatement.isPoolable
        }
예제 #2
0
 /**
  *
  * Constructs a new tinySQLStatement object.
  * @param conn the tinySQLConnection object
  *
  */
 public TinySQLStatement(TinySQLConnection conn)
 {
     connection = conn;
     if (debug)
     {
         java.lang.SystemJ.outJ.println("connection is " + connection.toString());
     }
 }