Package org.apache.jena.jdbc.connections

Examples of org.apache.jena.jdbc.connections.JenaConnection.prepareStatement()


     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_73() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, 123.4f, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123.4"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
View Full Code Here


     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_74() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, (short) 123, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDshort.getURI()));
View Full Code Here

     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_75() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, (byte) 123, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));
View Full Code Here

     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_76() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, true, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("true"));

View Full Code Here

     * @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>"));

View Full Code Here

     * @throws URISyntaxException
     */
    @Test
    public void prepared_statement_setters_78() throws SQLException, MalformedURLException, 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>"));

View Full Code Here

     * @throws MalformedURLException
     */
    @Test
    public void prepared_statement_setters_79() throws SQLException, MalformedURLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        Calendar c = Calendar.getInstance();
        stmt.setObject(1, c, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));
View Full Code Here

     * @throws MalformedURLException
     */
    @Test
    public void prepared_statement_setters_80() throws SQLException, MalformedURLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        Calendar c = Calendar.getInstance();
        Date dt = new Date(c.getTimeInMillis());
        stmt.setObject(1, dt, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
View Full Code Here

     * @throws MalformedURLException
     */
    @Test
    public void prepared_statement_setters_81() throws SQLException, MalformedURLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        Calendar c = Calendar.getInstance();
        Time t = new Time(c.getTimeInMillis());
        stmt.setObject(1, t, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
View Full Code Here

     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_82() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, new Object(), Types.JAVA_OBJECT);

        stmt.close();
        conn.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.