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/04/10 01:59:29 UTC

svn commit: r1466299 - /jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java

Author: rvesse
Date: Tue Apr  9 23:58:15 2013
New Revision: 1466299

URL: http://svn.apache.org/r1466299
Log:
Stub for JDBC PreparedStatement support

Added:
    jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java

Added: 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=1466299&view=auto
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java (added)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/statements/JenaPreparedStatement.java Tue Apr  9 23:58:15 2013
@@ -0,0 +1,356 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.jdbc.statements;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.NClob;
+import java.sql.ParameterMetaData;
+import java.sql.PreparedStatement;
+import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLXML;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Calendar;
+
+import org.apache.jena.jdbc.connections.JenaConnection;
+
+import com.hp.hpl.jena.query.ParameterizedSparqlString;
+
+/**
+ * Abstract Jena JDBC implementation of a prepared statement 
+ *
+ */
+public abstract class JenaPreparedStatement extends JenaStatement implements PreparedStatement {
+    
+    private ParameterizedSparqlString sparqlStr = new ParameterizedSparqlString();
+
+    public JenaPreparedStatement(JenaConnection connection, int fetchDir, int fetchSize, int holdability, boolean autoCommit,
+            int transactionLevel) throws SQLException {
+        super(connection, fetchDir, fetchSize, holdability, autoCommit, transactionLevel);
+    }
+
+    @Override
+    public void addBatch() throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void clearParameters() throws SQLException {
+        this.sparqlStr.clearParams();
+    }
+
+    @Override
+    public boolean execute() throws SQLException {
+        return this.execute(this.sparqlStr.toString());
+    }
+
+    @Override
+    public ResultSet executeQuery() throws SQLException {
+        return this.executeQuery(this.sparqlStr.toString());
+    }
+
+    @Override
+    public int executeUpdate() throws SQLException {
+        return this.executeUpdate(this.sparqlStr.toString());
+    }
+
+    @Override
+    public ResultSetMetaData getMetaData() throws SQLException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public ParameterMetaData getParameterMetaData() throws SQLException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void setArray(int arg0, Array arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setAsciiStream(int arg0, InputStream arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setAsciiStream(int arg0, InputStream arg1, int arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setAsciiStream(int arg0, InputStream arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setBinaryStream(int arg0, InputStream arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBinaryStream(int arg0, InputStream arg1, int arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBinaryStream(int arg0, InputStream arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBlob(int arg0, Blob arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBlob(int arg0, InputStream arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBlob(int arg0, InputStream arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setBoolean(int arg0, boolean arg1) throws SQLException {
+        this.sparqlStr.setLiteral(arg0 - 1, arg1);
+    }
+
+    @Override
+    public void setByte(int arg0, byte arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setBytes(int arg0, byte[] arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setCharacterStream(int arg0, Reader arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setCharacterStream(int arg0, Reader arg1, int arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setCharacterStream(int arg0, Reader arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setClob(int arg0, Clob arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setClob(int arg0, Reader arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setClob(int arg0, Reader arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setDate(int arg0, Date arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setDouble(int arg0, double arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setFloat(int arg0, float arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setInt(int arg0, int arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setLong(int arg0, long arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setNCharacterStream(int arg0, Reader arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNCharacterStream(int arg0, Reader arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNClob(int arg0, NClob arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNClob(int arg0, Reader arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNClob(int arg0, Reader arg1, long arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNString(int arg0, String arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNull(int arg0, int arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setNull(int arg0, int arg1, String arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setObject(int arg0, Object arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setObject(int arg0, Object arg1, int arg2) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setObject(int arg0, Object arg1, int arg2, int arg3) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setRef(int arg0, Ref arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setRowId(int arg0, RowId arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setSQLXML(int arg0, SQLXML arg1) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
+    @Override
+    public void setShort(int arg0, short arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setString(int arg0, String arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setTime(int arg0, Time arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setTime(int arg0, Time arg1, Calendar arg2) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setTimestamp(int arg0, Timestamp arg1, Calendar arg2) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void setURL(int arg0, URL arg1) throws SQLException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Deprecated
+    @Override
+    public void setUnicodeStream(int arg0, InputStream arg1, int arg2) throws SQLException {
+        throw new SQLFeatureNotSupportedException();
+    }
+}