Demos and Usage of java.sql.PreparedStatement.getParameterMetaData()


   1: Connection conn = null;
   2: PreparedStatement pstmt = null;
   3: ParameterMetaData paramMetaData = null;
   4:         ...
   5: pstmt = conn.prepareStatement(query);
   6: paramMetaData = pstmt.getParameterMetaData();
   7: if (paramMetaData == null) {
   8: System.out.println("db vendor does NOT support ParameterMetaData");
   9: }

View Full Code Here
   1: public class PreparedStatementAdapter extends StatementAdapter
   2:         implements PreparedStatement
   3:  {
   4:         ...
   5: 
   6:     protected PreparedStatement pstmt;
   7: 
   8:         ...
   9:     public PreparedStatementAdapter(PreparedStatement pstmt) {
  10:         super(pstmt);
  11:         ...
  12:     public ParameterMetaData getParameterMetaData()throws SQLException {
  13:         return pstmt.getParameterMetaData();

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5: 
   6: public abstract class FilterPreparedStatement implements PreparedStatement
   7: {
   8:         ...
   9:     protected PreparedStatement inner;
  10:     
  11:         ...
  12:     public ParameterMetaData getParameterMetaData() throws SQLException
  13:     { return inner.getParameterMetaData(); }

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5: 
   6: public abstract class SynchronizedFilterPreparedStatement implements PreparedStatement
   7: {
   8:         ...
   9:     protected PreparedStatement inner;
  10:     
  11:         ...
  12:     public synchronized ParameterMetaData getParameterMetaData() throws SQLException
  13:     { return inner.getParameterMetaData(); }

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5:     
   6:     private PreparedStatement stmt;
   7:     private ResultSet rs;
   8:         ...
   9:             }
  10:             int count = stmt.getParameterMetaData().getParameterCount();
  11:             while(count>0) {
  12:         ...
  13:     public ParameterMetaData getParameterMetaData() throws SQLException {
  14:         return stmt.getParameterMetaData();

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.ResultSet;
   4:         ...
   5: 
   6: public class DCPreparedStatement extends DCStatement implements PreparedStatement, Constants {
   7:   private static final byte[] NULL_BYTES = "null".getBytes();
   8:         ...
   9:   protected PreparedStatement realPS;
  10:   protected PreparedStatement queryUpdateRowsPS = null;
  11:         ...
  12:   public ParameterMetaData getParameterMetaData() throws SQLException {
  13:     return realPS.getParameterMetaData();

View Full Code Here
   1: public class UserPreparedStatement extends UserStatement
   2:   implements PreparedStatement {
   3:   protected final static Logger log = Log.open(UserPreparedStatement.class);
   4:         ...
   5: 
   6:   protected PreparedStatement _pstmt;
   7:   protected PreparedStatementCacheItem _cacheItem;
   8:         ...
   9:   UserPreparedStatement(UserConnection conn,
  10:             PreparedStatement pStmt,
  11:             PreparedStatementCacheItem cacheItem)
  12:         ...
  13:     try {
  14:       return _pstmt.getParameterMetaData();

View Full Code Here
   1: import java.sql.Connection;
   2: import java.sql.PreparedStatement;
   3: import java.sql.ResultSet;
   4:         ...
   5:   private String _query;
   6:   private PreparedStatement _stmt;
   7:   private ResultSetMetaData _metaData;
   8:         ...
   9: 
  10:   protected PreparedStatement getPreparedStatement()
  11:   {
  12:         ...
  13:     try {
  14:       java.sql.ParameterMetaData pmd = _stmt.getParameterMetaData();

View Full Code Here
   1: import java.sql.SQLException;
   2: import java.sql.PreparedStatement;
   3: import java.sql.ResultSet;
   4:         ...
   5:    {
   6:       PreparedStatement updater = null;
   7:         ...
   8:       PreparedStatement selecter = null;
   9:       ResultSet rs = null;

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5: 
   6: public class PreparedStatementProxy implements PreparedStatement {
   7: 
   8:         ...
   9:     
  10:     private PreparedStatement preparedStatement;
  11:     
  12:         ...
  13:     public ParameterMetaData getParameterMetaData() throws SQLException {
  14:         return preparedStatement.getParameterMetaData();

View Full Code Here
   1: public class SpyPreparedStatement extends SpyStatement
   2:   implements java.sql.PreparedStatement {
   3:   protected final static Logger log = Log.open(SpyPreparedStatement.class);
   4:         ...
   5:   private String _sql;
   6:   protected PreparedStatement _pstmt;
   7: 
   8:         ...
   9:   SpyPreparedStatement(String id, SpyConnection conn,
  10:                        PreparedStatement stmt, String sql)
  11:   {
  12:         ...
  13:   {
  14:     return _pstmt.getParameterMetaData();

View Full Code Here
   1: public class PreparedStatementWrapper
   2:   implements PreparedStatement
   3: {
   4:         ...
   5:   private final PreparedStatement _preparedStatement;
   6:   private ProfilerPoint _profilerPoint;
   7:         ...
   8:   public PreparedStatementWrapper(ProfilerPoint profilerPoint,
   9:                                   PreparedStatement preparedStatement)
  10:   {
  11:         ...
  12:     try {
  13:       return _preparedStatement.getParameterMetaData();

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5: 
   6: public final class PreparedStatementProxy implements PreparedStatement {
   7: 
   8:         ...
   9:     
  10:     private PreparedStatement _preparedStatement;
  11:     
  12:         ...
  13:     public ParameterMetaData getParameterMetaData() throws SQLException {
  14:         return _preparedStatement.getParameterMetaData();

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.ResultSet;
   4:         ...
   5: 
   6: public class LoggablePreparedStatement implements PreparedStatement {
   7: 
   8:         ...
   9: 
  10:     private PreparedStatement pstm;
  11: 
  12:         ...
  13:     public ParameterMetaData getParameterMetaData() throws SQLException {
  14:         return pstm.getParameterMetaData();

View Full Code Here
   1: import java.sql.ParameterMetaData;
   2: import java.sql.PreparedStatement;
   3: import java.sql.Ref;
   4:         ...
   5:       }
   6:       public PreparedStatement prepareStatement(String sql) throws SQLException {
   7:         if (closed) throw new SQLException("Connection is closed");
   8:         ...
   9:     PreparedStatement statement = null;
  10:         try {
  11:         ...
  12:           try {
  13:         return thePreparedStatement.getParameterMetaData();

View Full Code Here