You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/06/07 20:35:35 UTC

svn commit: r1490775 - in /jena/Experimental/jena-jdbc/jena-jdbc-core/src: main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java

Author: rvesse
Date: Fri Jun  7 18:35:35 2013
New Revision: 1490775

URL: http://svn.apache.org/r1490775
Log:
Finish test coverage for prepared statements

Modified:
    jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java
    jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java

Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java?rev=1490775&r1=1490774&r2=1490775&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java Fri Jun  7 18:35:35 2013
@@ -473,8 +473,12 @@ public abstract class JenaPreparedStatem
                 }
                 break;
             case Types.INTEGER:
-                if (value instanceof Integer || value instanceof Short || value instanceof Byte) {
+                if (value instanceof Integer) {
                     this.setParameter(parameterIndex, NodeFactoryExtra.intToNode((Integer)value));
+                } else if (value instanceof Short) {
+                    this.setParameter(parameterIndex, NodeFactoryExtra.intToNode((int)(Short)value));
+                } else if (value instanceof Byte) {
+                    this.setParameter(parameterIndex, NodeFactoryExtra.intToNode((int)(Byte)value));
                 } else if (value instanceof Node) {
                     Integer i = JdbcNodeUtils.toInt((Node)value);
                     this.setParameter(parameterIndex, NodeFactoryExtra.intToNode(i));
@@ -505,6 +509,8 @@ public abstract class JenaPreparedStatem
                     this.setParameter(parameterIndex, NodeFactoryExtra.doubleToNode((Double)value));
                 } else if (value instanceof Float) {
                     this.setParameter(parameterIndex, NodeFactoryExtra.floatToNode((Float)value));
+                } else if (value instanceof Short) {
+                    this.setParameter(parameterIndex, NodeFactory.createLiteral(Short.toString((Short)value), XSDDatatype.XSDshort));
                 } else if (value instanceof Integer) {
                     this.setParameter(parameterIndex, NodeFactoryExtra.intToNode((Integer)value));
                 } else if (value instanceof Long) {

Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java?rev=1490775&r1=1490774&r2=1490775&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/statements/AbstractJenaStatementTests.java Fri Jun  7 18:35:35 2013
@@ -1677,7 +1677,7 @@ public abstract class AbstractJenaStatem
             conn.close();
         }
     }
-    
+
     /**
      * Tests error cases for setters on prepared statements
      * 
@@ -1696,7 +1696,216 @@ public abstract class AbstractJenaStatem
             conn.close();
         }
     }
-    
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_05() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // No RDF equivalent for unknown SQL Type
+            stmt.setObject(1, new Object(), Integer.MAX_VALUE);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_06() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.BIGINT);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_07() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.BOOLEAN);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_08() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.DATE);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_09() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.DECIMAL);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_10() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.DOUBLE);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_11() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.FLOAT);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_12() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.INTEGER);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_13() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.SMALLINT);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_14() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.TINYINT);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
+    /**
+     * Tests error cases for setters on prepared statements
+     * 
+     * @throws SQLException
+     */
+    @Test(expected = SQLException.class)
+    public void prepared_statement_bad_setters_15() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        PreparedStatement stmt = conn.prepareStatement("SELECT * WHERE { ? ?p ?o }");
+
+        try {
+            // Invalid cast
+            stmt.setObject(1, new Object(), Types.TIME);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
+    }
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -1711,6 +1920,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, "value");
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("\"value\""));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1727,6 +1939,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 123);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1743,6 +1958,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 123l);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1760,6 +1978,9 @@ public abstract class AbstractJenaStatem
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1776,6 +1997,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, BigDecimal.valueOf(1234, 1));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123.4"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1792,6 +2016,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, (short) 123);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1809,6 +2036,9 @@ public abstract class AbstractJenaStatem
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1825,6 +2055,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 12.3d);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1841,6 +2074,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, true);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("true"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1857,6 +2093,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, new Date(0));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDdate.getURI()));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1873,6 +2112,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, new Time(0));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDtime.getURI()));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1890,6 +2132,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, new URL("http://example.org"));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("<http://example.org>"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1908,6 +2153,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, new URI("http://example.org"));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("<http://example.org>"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1924,6 +2172,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("<http://example.org>"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1940,6 +2191,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, IRIFactory.iriImplementation().create("http://example.org"), Types.NVARCHAR);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("\"http://example.org\""));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1956,6 +2210,9 @@ public abstract class AbstractJenaStatem
         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();
     }
 
     /**
@@ -1973,6 +2230,9 @@ public abstract class AbstractJenaStatem
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
         Assert.assertFalse(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -1989,6 +2249,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 12.3d, Types.DOUBLE);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2005,6 +2268,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 123l, Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2021,6 +2287,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, 123, Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2037,6 +2306,9 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, (short) 123, Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2053,8 +2325,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, (byte) 123, Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+        
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2069,8 +2344,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, Quad.defaultGraphIRI);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("<urn:x-arq:DefaultGraph>"));
+        
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2085,8 +2363,11 @@ public abstract class AbstractJenaStatem
         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();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2102,8 +2383,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, c);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));
+        
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2116,9 +2400,14 @@ public abstract class AbstractJenaStatem
         JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
 
         // Setting random types (e.g. this test class) is not supported
-        stmt.setObject(1, this);
+        try {
+            stmt.setObject(1, this);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2130,10 +2419,15 @@ public abstract class AbstractJenaStatem
         JenaConnection conn = this.getConnection();
         JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
 
-        // Setting null is illegal
-        stmt.setObject(1, null);
+        try {
+            // Setting null is illegal
+            stmt.setObject(1, null);
+        } finally {
+            stmt.close();
+            conn.close();
+        }
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2148,8 +2442,11 @@ public abstract class AbstractJenaStatem
         stmt.setBigDecimal(1, BigDecimal.valueOf(1234, 1));
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123.4"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2164,8 +2461,11 @@ public abstract class AbstractJenaStatem
         stmt.setBoolean(1, true);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("true"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2181,8 +2481,11 @@ public abstract class AbstractJenaStatem
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2198,6 +2501,9 @@ public abstract class AbstractJenaStatem
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
         Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
+
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2214,8 +2520,11 @@ public abstract class AbstractJenaStatem
         stmt.setDouble(1, 12.3d);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("12.3"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2230,6 +2539,9 @@ public abstract class AbstractJenaStatem
         stmt.setInt(1, 123);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
     }
 
     /**
@@ -2246,8 +2558,11 @@ public abstract class AbstractJenaStatem
         stmt.setLong(1, 123l);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2263,8 +2578,11 @@ public abstract class AbstractJenaStatem
         stmt.setDate(1, dt);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(Integer.toString(Calendar.getInstance().get(Calendar.YEAR))));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2279,8 +2597,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, NodeFactoryExtra.intToNode(123l), Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2295,8 +2616,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, "123", Types.BIGINT);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2311,8 +2635,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, true, Types.BOOLEAN);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("true"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2327,8 +2654,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, NodeFactory.createLiteral("true", XSDDatatype.XSDboolean), Types.BOOLEAN);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("true"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2343,8 +2673,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, "true", Types.BOOLEAN);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("true"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2360,8 +2693,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, c, Types.DATE);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2377,8 +2713,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, NodeFactoryExtra.dateTimeToNode(c), Types.DATE);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2389,14 +2728,17 @@ public abstract class AbstractJenaStatem
     public void prepared_statement_setters_43() throws SQLException {
         JenaConnection conn = this.getConnection();
         JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
-        
+
         @SuppressWarnings("deprecation")
         Time t = new Time(0, 0, 0);
         stmt.setObject(1, t, Types.DATE);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("00:00:00"));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2412,8 +2754,11 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, dt, Types.DATE);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains(Integer.toString(Calendar.getInstance().get(Calendar.YEAR))));
+
+        stmt.close();
+        conn.close();
     }
-    
+
     /**
      * Tests that the various set methods of {@link JenaPreparedStatement}
      * function correctly
@@ -2428,5 +2773,737 @@ public abstract class AbstractJenaStatem
         stmt.setObject(1, BigDecimal.valueOf(1234, 1), Types.DECIMAL);
         ParameterizedSparqlString pss = stmt.getParameterizedString();
         Assert.assertTrue(pss.toString().contains("123.4"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_46() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactory.createLiteral(BigDecimal.valueOf(1234, 1).toPlainString(), XSDDatatype.XSDdecimal),
+                Types.DECIMAL);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123.4"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_47() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactoryExtra.doubleToNode(123.4d), Types.DOUBLE);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123.4"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_48() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, 123.4f, Types.FLOAT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123.4"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_49() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactoryExtra.floatToNode(123.4f), Types.FLOAT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123.4"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_50() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, 123, Types.INTEGER);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_51() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, (short) 123, Types.INTEGER);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_52() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, (byte) 123, Types.INTEGER);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_53() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactoryExtra.intToNode(123), Types.INTEGER);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * 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();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_55() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, (byte) 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();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_56() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactory.createLiteral("123", XSDDatatype.XSDshort), Types.SMALLINT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDshort.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_57() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        Calendar c = Calendar.getInstance();
+        stmt.setObject(1, c, Types.TIME);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.HOUR))));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_58() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        Calendar c = Calendar.getInstance();
+        stmt.setObject(1, NodeFactoryExtra.dateTimeToNode(c), Types.TIME);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.HOUR))));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_59() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        @SuppressWarnings("deprecation")
+        Time t = new Time(0, 0, 0);
+        stmt.setObject(1, t, Types.TIME);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("00:00:00"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_60() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        Date dt = new Date(Calendar.getInstance().getTimeInMillis());
+        stmt.setObject(1, dt, Types.TIME);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains(Integer.toString(Calendar.getInstance().get(Calendar.HOUR))));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_61() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, (byte) 123, Types.TINYINT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_62() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactory.createLiteral("123", XSDDatatype.XSDbyte), Types.TINYINT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDbyte.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_63() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, "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();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_64() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setShort(1, (short) 123);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDshort.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_65() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        @SuppressWarnings("deprecation")
+        Time t = new Time(0, 0, 0);
+        stmt.setTime(1, t);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("00:00:00"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_66() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, NodeFactory.createURI("http://example"), Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("<http://example>"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_67() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, ModelFactory.createDefaultModel().createResource("http://example"), Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("<http://example>"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_68() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, "test", Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("test"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * 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();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_70() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, 123l, Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_71() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, 123, Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     */
+    @Test
+    public void prepared_statement_setters_72() throws SQLException {
+        JenaConnection conn = this.getConnection();
+        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");
+
+        stmt.setObject(1, 123.4d, Types.JAVA_OBJECT);
+        ParameterizedSparqlString pss = stmt.getParameterizedString();
+        Assert.assertTrue(pss.toString().contains("123.4"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @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()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @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()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @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()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @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"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * 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();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     * @throws MalformedURLException
+     * @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>"));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     * @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))));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDdateTime.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     * @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();
+        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.YEAR))));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDdateTime.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    /**
+     * Tests that the various set methods of {@link JenaPreparedStatement}
+     * function correctly
+     * 
+     * @throws SQLException
+     * @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();
+        Assert.assertTrue(pss.toString().contains(Integer.toString(c.get(Calendar.HOUR))));
+        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDtime.getURI()));
+
+        stmt.close();
+        conn.close();
+    }
+
+    @Test
+    public void prepared_statement_stters_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();
     }
 }