[kepler-dev] parameter table in provenance module

DONGHOON KIM dhkim717 at gmail.com
Wed Nov 12 10:30:11 PST 2014


Thank you, Daniel,

First time, I tried to add _psParameter2Insert right after
_psParameterInsert as I emailed to the community (below).
but, I still have  an error message; unknown column in 'field...

parameter2 table (_psParameter2Insert) has five fields while parameter
table (_psParameterInsert) has three fields.
once it reaches the fourth field, it has unknown column in field.. error
message.

Now I am trying to implement _regParameter2Real which is the same as
_regParameterReal.
I followed _psParameterInsert for _psParameter2Insert. I also added some
code for "_psParameter2Insert" in _createPreparedStatements().
so once the program calls _regParameterReal, then the program also
calls _regParameter2Real .
This solution seems like partial solution. it only works when regParameter
in SQLRecording.java works. the other case, when regParameter in
SQLRecording.java calls, it is still the same error (i.e., unknown column
error).

Do you have any thing that I should consider for using multiple
PreparedStatements in the same method like below code?

Thank you

-Donghoon





On Wed, Nov 12, 2014 at 12:38 PM, Daniel Crawl <danielcrawl at gmail.com>
wrote:

>
> Hi Donghoon,
>
> How did you create _psParameter2Insert? You can look at
> _createPreparedStatements() for examples.
>
>   --dan
>
>
> On 11/11/14 7:27 PM, DONGHOON KIM wrote:
>
>> Dear Kepler folks,
>>
>> I need to add one more table (e.g., parameter2) in Provenance database.
>> parameter2 table should have parameter information with different
>> properties. In other words, it includes some other information that
>> parameter table does not have.
>> so I am try to use _regparamterReal(Name obj, RegEntity re) because this
>> method add parameter information into parameter table.
>> so I tried to add parameter2 table. but I have a error message;  unknown
>> column in 'field list'
>> My question is how can I insert another table (i.e., parameter2) from
>> parameter table. I think the problem is that I should switch or initialize
>> for _psParameter2Insert for "PreparedStatement".
>> Below is the code in "org.kepler.provenance.sql.SQLRecording.java". Also
>> you can find where the error happens below.
>>
>> line number around 1728
>>
>>      /** Add an entity to the parameter table. */
>>      protected void _regParameterReal(NamedObj parameter, RegEntity re)
>>          throws RecordingException
>>      {
>>          String className = parameter.getClassName();
>>          String valueStr = "none";
>>
>>
>>
>>
>>
>>          try //_psParameterInsert
>>          {
>>              synchronized(_psParameterInsert)
>>              {
>>                  //_debug("going to insert parameter " +
>> _getNameableFullName(parameter) + " with id " + re.getId());
>>
>>                  _psParameterInsert.setInt(1, re.getId());
>>                  _psParameterInsert.setString(2, className);
>>
>>
>>                  if(parameter instanceof AbstractSettableAttribute)
>>                  {
>>                      valueStr = ((AbstractSettableAttribute)parameter).
>>                          getValueAsString();
>>                  }
>>
>>                  // replace null string with empty string.
>>                  if(valueStr == null)
>>                  {
>>                      valueStr = "";
>>                  }
>>
>>                  //_debug(_getNameableFullName(parameter) + " value
>> length =
>> " + valueStr.length());
>>
>>                  // XXX need to set truncated bit somewhere
>>                  if(valueStr.length() > _maxParameterValueSize)
>>                  {
>>                      //_debug("TRUNCATING!");
>>                      valueStr = valueStr.substring(0,
>> _maxParameterValueSize);
>>                  }
>>
>>
>>
>>                  _psParameterInsert.setString(3, valueStr);
>>
>>                  _psParameterInsert.executeUpdate();
>>
>> /*********** added by Donghoon
>>                  _psParameter2Insert.setInt(1, re.getId());
>>                  _psParameter2Insert.setString(2, className);
>>                  _psParameter2Insert.setString(3, valueStr);
>>
>>                  //==>>>>error message this line  ; unknown column in
>> 'field
>> list'  <<<===============
>>                  _psParameter2Insert.setString(4, valueStr);
>>
>>                  _psParameter2Insert.executeUpdate();
>>
>>
>>              }
>>
>>
>>
>>
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>
>>
>


-- 
Donghoon Kim
Dept of Computer Science
North Carolina State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20141112/67262333/attachment.html>


More information about the Kepler-dev mailing list