use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_34.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_34() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setLong(1, 123l);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("123"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_24.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_24() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, ModelFactory.createDefaultModel().createResource("urn:x-arq:DefaultGraph"));
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("<urn:x-arq:DefaultGraph>"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_38.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_38() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, true, Types.BOOLEAN);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("true"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_16.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_16() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"), Types.JAVA_OBJECT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("<http://example.org>"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_78.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
* @throws URISyntaxException
*/
@Test
public void prepared_statement_setters_78() throws SQLException, URISyntaxException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, new URI("http://example"), Types.JAVA_OBJECT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("<http://example>"));
stmt.close();
conn.close();
}
Aggregations