70 m_connServ->configuration().setConnectionTimeOut(0);
75 coral::TableDescription descr(
"OraDb" );
77 descr.insertColumn(
"P_LOCK",
78 coral::AttributeSpecification::typeNameForType<int>() );
79 descr.setNotNullConstraint(
"P_LOCK" );
80 descr.setPrimaryKey( std::vector<std::string>( 1,
"P_LOCK" ) );
81 coral::ITable&
table = schema.createTable( descr );
82 table.privilegeManager().grantToPublic( coral::ITablePrivilegeManager::Select );
84 coral::ITable& table = schema.tableHandle(
tableName() );
85 std::string condition(
"P_LOCK = 1");
86 std::auto_ptr<coral::IQuery>
query( table.newQuery() );
87 query->addToOutputList(
"P_LOCK" );
88 query->defineOutputType(
"P_LOCK", coral::AttributeSpecification::typeNameForType<int>());
89 query->setCondition( condition, coral::AttributeList() );
90 query->setForUpdate();
91 coral::ICursor& cursor =
query->execute();
92 coral::AttributeList
data;
93 data.extend<
int>(
"P_LOCK" );
94 data[
"P_LOCK"].data<
int>() = 1;
97 std::string setCLause =
"P_LOCK = :P_LOCK";
98 table.dataEditor().updateRows( setCLause, condition , data );
101 table.dataEditor().insertRow( data );
std::auto_ptr< coral::ISessionProxy > m_session
std::auto_ptr< coral::ConnectionService > m_connServ
static const std::string & tableName()
char data[epos_bytes_allocation]