db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: PlatformImplBase.store() proposal
Date Fri, 22 Feb 2008 16:30:18 GMT
On Wed, Feb 20, 2008 at 11:36 PM, Rijk van Haaften
<r.j.c.vanhaaften@gmail.com> wrote:
> > Look at the fetch method implementation, it does similar things and
>  >  you can probably use it as a blueprint for the exists one.
>  I did and think the implementation should be:
>  Statement statement = null;
>  ResultSet resultSet = null;
>  boolean exists = false;
>  try
>  {
>     statement = connection.createStatement();
>     resultSet = statement.executeQuery(sql.toString());
>     exists = resultSet.next();
>     resultSet.close();
>
> }
>  catch (SQLException ex)
>  {
>     throw new DatabaseOperationException("Error while reading from the
>  database", ex);
>  }
>  finally
>  {
>     closeStatement(statement);
>  }
>  return exists;
>
>  As I have no commit rights (and as far as I know, you are currently
>  the only committer), committing is up to you.

Please create a issue in DdlUtils' JIRA and attach the code to it.

thanks,
Tom

Mime
View raw message