To create Column need to add some code in storage-conf.xml.The next thing we need to do is to locate and configure the database storage-conf.xml file.which is found in conf folder.Open the storage-conf.xml in your favorite text editor.now Add the following code under tag.
<Keyspace Name="Blog">
<ColumnFamily Name="Post"
ColumnType="Super"
CompareWith="UTF8Type"
CompareSubcolumnsWith="UTF8Type"
Comment="A column family with supercolumns, whose column and subcolumn names are UTF8 strings" />
</Keyspace>
save it.The above configuration creates one Column Family(or table).called Posts in a Keyspace (or database ) called Blog.
We are going to use this column family in our code below.
<Keyspace Name="Blog">
<ColumnFamily Name="Post"
ColumnType="Super"
CompareWith="UTF8Type"
CompareSubcolumnsWith="UTF8Type"
Comment="A column family with supercolumns, whose column and subcolumn names are UTF8 strings" />
</Keyspace>
save it.The above configuration creates one Column Family(or table).called Posts in a Keyspace (or database ) called Blog.
We are going to use this column family in our code below.
Comments
Post a Comment