StringBuffer query = new StringBuffer();
query.append("SELECT distinct RP_NAME, RP_ID from DB.DBA.RDF_PREFIX");
try
{
java.sql.Statement stmt = this.connection.createStatement();
VirtuosoResultSet results = (VirtuosoResultSet) stmt.executeQuery(query.toString());
ResultSetMetaData data = results.getMetaData();
// begin at onset one
while (results.next())
{
String name = null;
String prefix = null;
for (int meta_count = 1; meta_count <= data.getColumnCount(); meta_count++)
{
// TODO need to parse these into appropriate resource values
String col = data.getColumnName(meta_count);
if(col.equals("RP_ID"))
{
name = results.getString(col);
}
else if(col.equals("RP_NAME"))
{
prefix = results.getString(col);
}
}
if(name != null && prefix != null)
{
org.openrdf.sesame.sailimpl.memory.Namespace ns = new org.openrdf.sesame.sailimpl.memory.Namespace(prefix, name, false);