[kepler-dev] parameter table in provenance module
Daniel Crawl
danielcrawl at gmail.com
Wed Nov 12 09:38:49 PST 2014
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
>
More information about the Kepler-dev
mailing list