use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_77.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
* @throws MalformedURLException
*/
@Test
public void prepared_statement_setters_77() throws SQLException, MalformedURLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, new URL("http://example"), Types.JAVA_OBJECT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("<http://example>"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_69.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_69() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, BigDecimal.valueOf(1234, 1), Types.JAVA_OBJECT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("123.4"));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_54.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_54() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, (short) 123, Types.SMALLINT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("123"));
Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDshort.getURI()));
stmt.close();
conn.close();
}
use of org.apache.jena.query.ParameterizedSparqlString in project jena by apache.
the class AbstractJenaStatementTests method prepared_statement_setters_33.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_33() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setInt(1, 123);
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_20.
/**
* Tests that the various set methods of {@link JenaPreparedStatement}
* function correctly
*
* @throws SQLException
*/
@Test
public void prepared_statement_setters_20() throws SQLException {
JenaConnection conn = this.getConnection();
JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
stmt.setObject(1, 123, Types.BIGINT);
ParameterizedSparqlString pss = stmt.getParameterizedString();
Assert.assertTrue(pss.toString().contains("123"));
stmt.close();
conn.close();
}
Aggregations