This discussion is archived
1 Reply Latest reply: Oct 25, 2011 9:10 AM by alwu RSS

Database Query

887107 Newbie
Currently Being Moderated
Hi everyone
in http://download.oracle.com/docs/cd/E16338_01/appdev.112/e11828/sem_jena.htm#CBBCIJAD there are examples query the data that there are inserted throw java.
there is any example that i can query the data that i have saved in my Oracle Database?
thx a alot
  • 1. Re: Database Query
    alwu Pro
    Currently Being Moderated
    Hi,

    There are many examples in that document. You can search for "QueryFactory.create"

    e.g. Example 7-5

    String queryString =
    " *SELECT ?subject ?prop ?object WHERE { ?subject ?prop ?object }* ";

    Query query = QueryFactory.create(queryString) ;
    QueryExecution qexec = QueryExecutionFactory.create(query, model) ;

    try {
    int iTriplesCount = 0;
    ResultSet results = qexec.execSelect() ;
    for ( ; results.hasNext() ; ) {
    ...

    Thanks,

    Zhe

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points