diff --git a/src/util/sqlite3-statement.cpp b/src/util/sqlite3-statement.cpp
new file mode 100644
index 0000000..243088b
--- /dev/null
+++ b/src/util/sqlite3-statement.cpp
@@ -0,0 +1,115 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "sqlite3-statement.hpp"
+
+#include <sqlite3.h>
+
+namespace ndn {
+namespace util {
+
+Sqlite3Statement::~Sqlite3Statement()
+{
+  sqlite3_finalize(m_stmt);
+}
+
+Sqlite3Statement::Sqlite3Statement(sqlite3* database, const std::string& statement)
+{
+  int res = sqlite3_prepare_v2(database, statement.c_str(), -1, &m_stmt, nullptr);
+  if (res != SQLITE_OK)
+    throw std::domain_error("bad SQL statement: " + statement);
+}
+
+int
+Sqlite3Statement::bind(int index, const char* value, size_t size, void(*destructor)(void*))
+{
+  return sqlite3_bind_text(m_stmt, index, value, size, destructor);
+}
+
+int
+Sqlite3Statement::bind(int index, const std::string& value, void(*destructor)(void*))
+{
+  return sqlite3_bind_text(m_stmt, index, value.c_str(), value.size(), destructor);
+}
+
+int
+Sqlite3Statement::bind(int index, const void* buf, size_t size, void(*destructor)(void*))
+{
+  return sqlite3_bind_blob(m_stmt, index, buf, size, destructor);
+}
+
+int
+Sqlite3Statement::bind(int index, const Block& block, void(*destructor)(void*))
+{
+  return sqlite3_bind_blob(m_stmt, index, block.wire(), block.size(), destructor);
+}
+
+int
+Sqlite3Statement::bind(int index, int number)
+{
+  return sqlite3_bind_int(m_stmt, index, number);
+}
+
+std::string
+Sqlite3Statement::getString(int column)
+{
+  return std::string(reinterpret_cast<const char*>(sqlite3_column_text(m_stmt, column)),
+                     sqlite3_column_bytes(m_stmt, column));
+}
+
+Block
+Sqlite3Statement::getBlock(int column)
+{
+  return Block(sqlite3_column_blob(m_stmt, column), sqlite3_column_bytes(m_stmt, column));
+}
+
+int
+Sqlite3Statement::getInt(int column)
+{
+  return sqlite3_column_int(m_stmt, column);
+}
+
+
+const uint8_t*
+Sqlite3Statement::getBlob(int column)
+{
+  return static_cast<const uint8_t*>(sqlite3_column_blob(m_stmt, column));
+}
+
+int
+Sqlite3Statement::getSize(int column)
+{
+  return sqlite3_column_bytes(m_stmt, column);
+}
+
+int
+Sqlite3Statement::step()
+{
+  return sqlite3_step(m_stmt);
+}
+
+Sqlite3Statement::operator sqlite3_stmt*()
+{
+  return m_stmt;
+}
+
+} // namespace util
+} // namespace ndn
diff --git a/src/util/sqlite3-statement.hpp b/src/util/sqlite3-statement.hpp
new file mode 100644
index 0000000..dbad1d2
--- /dev/null
+++ b/src/util/sqlite3-statement.hpp
@@ -0,0 +1,158 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_SQLITE3_STATEMENT_HPP
+#define NDN_UTIL_SQLITE3_STATEMENT_HPP
+
+#include "../encoding/block.hpp"
+#include <string>
+
+struct sqlite3;
+struct sqlite3_stmt;
+
+namespace ndn {
+namespace util {
+
+/**
+ * @brief wrap an SQLite3 prepared statement
+ * @warning This class is implementation detail of ndn-cxx library.
+ */
+class Sqlite3Statement : noncopyable
+{
+public:
+  /**
+   * @brief initialize and prepare Sqlite3 statement
+   * @param database handler to open sqlite3 database
+   * @param statement SQL statement
+   * @throw std::domain_error SQL statement is bad
+   */
+  Sqlite3Statement(sqlite3* database, const std::string& statement);
+
+  /**
+   * @brief finalize the statement
+   */
+  ~Sqlite3Statement();
+
+  /**
+   * @brief bind a string to the statement
+   *
+   * @param index The binding position
+   * @param value The pointer of the binding string
+   * @param value The size of the binding string
+   * @param destructor SQLite3 destructor, e.g., SQLITE_TRANSIENT
+   * @return SQLite result value.
+   */
+  int
+  bind(int index, const char* value, size_t size, void(*destructor)(void*));
+
+  /**
+   * @brief bind a string to the statement
+   *
+   * @param index The binding position
+   * @param value The binding string
+   * @param destructor SQLite3 destructor, e.g., SQLITE_TRANSIENT
+   * @return SQLite result value.
+   */
+  int
+  bind(int index, const std::string& value, void(*destructor)(void*));
+
+  /**
+   * @brief bind a byte blob to the statement
+   *
+   * @param index The binding position
+   * @param value The pointer of the blob
+   * @param value The size of the blob
+   * @param destructor SQLite3 destructor, e.g., SQLITE_TRANSIENT
+   * @return SQLite result value.
+   */
+  int
+  bind(int index, const void* value, size_t size, void(*destructor)(void*));
+
+  /**
+   * @brief bind a byte blob to the statement
+   *
+   * @param index The binding position
+   * @param block The binding block
+   * @param destructor SQLite3 destructor, e.g., SQLITE_TRANSIENT
+   * @return SQLite result value
+   */
+  int
+  bind(int index, const Block& block, void(*destructor)(void*));
+
+  /**
+   * @brief bind an integer to the statement
+   *
+   * @param index The binding position
+   * @param number The binding integer
+   * @return SQLite result value
+   */
+  int
+  bind(int index, int number);
+
+  /**
+   * @brief get a string from @p column.
+   */
+  std::string
+  getString(int column);
+
+  /**
+   * @brief get a block from @p column.
+   */
+  Block
+  getBlock(int column);
+
+  /**
+   * @brief get an integer from @p column.
+   */
+  int
+  getInt(int column);
+
+  /**
+   * @brief get a pointer of byte blob from @p column.
+   */
+  const uint8_t*
+  getBlob(int column);
+
+  /**
+   * @brief get the size of @p column.
+   */
+  int
+  getSize(int column);
+
+  /**
+   * @brief wrapper of sqlite3_step
+   */
+  int
+  step();
+
+  /**
+   * @brief implicitly converts to sqlite3_stmt* to be used in SQLite C API
+   */
+  operator sqlite3_stmt*();
+
+private:
+  sqlite3_stmt* m_stmt;
+};
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_SQLITE3_STATEMENT_HPP
