// Path: src/main/java/io/vertx/jdbcclient/impl/actions/JDBCColumnDescriptor.java
// public class JDBCColumnDescriptor implements ColumnDescriptor {
// 
//   private final String columnLabel;
//   private final JDBCTypeWrapper jdbcTypeWrapper;
// 
//   private JDBCColumnDescriptor(String columnLabel, JDBCTypeWrapper jdbcTypeWrapper) {
//     this.columnLabel = columnLabel;
//     this.jdbcTypeWrapper = jdbcTypeWrapper;
//   }
// 
//   @Override
//   public String name() {
//     return columnLabel;
//   }
// 
//   @Override
//   public boolean isArray() {
//     return jdbcType() == JDBCType.ARRAY;
//   }
// 
//   @Override
//   public String typeName() {
//     return jdbcTypeWrapper.vendorTypeName();
//   }
// 
//   /**
//    * Use {@link #jdbcTypeWrapper()} when converting an advanced data type depending on the specific database
//    *
//    * @return the most appropriate {@code JDBCType} or {@code null} if it is advanced type of specific database
//    */
//   @Override
//   public JDBCType jdbcType() {
//     return jdbcTypeWrapper.jdbcType();
//   }
// 
//   /**
//    * @return the jdbc type wrapper
//    * @see JDBCTypeWrapper
//    */
//   public JDBCTypeWrapper jdbcTypeWrapper() {
//     return this.jdbcTypeWrapper;
//   }
// 
//   @Override
//   public String toString() {
//     return "JDBCColumnDescriptor[columnName=(" + columnLabel + "), jdbcTypeWrapper=(" + jdbcTypeWrapper + ")]";
//   }
// 
//   public static JDBCColumnDescriptor create(JDBCPropertyAccessor<String> columnLabel,
//                                             JDBCPropertyAccessor<Integer> vendorTypeNumber,
//                                             JDBCPropertyAccessor<String> vendorTypeName,
//                                             JDBCPropertyAccessor<String> vendorTypeClassName) throws SQLException {
//     return new JDBCColumnDescriptor(columnLabel.get(), JDBCTypeWrapper.of(vendorTypeNumber.get(), vendorTypeName.get(),
//       vendorTypeClassName.get()));
//   }
// 
//   public static JDBCColumnDescriptor wrap(JDBCType jdbcType) {
//     return new JDBCColumnDescriptor(null, JDBCTypeWrapper.of(jdbcType));
//   }
// 
// }
// 
// Path: src/main/java/io/vertx/jdbcclient/impl/actions/JDBCPropertyAccessor.java
// public interface JDBCPropertyAccessor<T> {
// 
//   Logger LOG = LoggerFactory.getLogger(JDBCColumnDescriptor.class);
// 
//   T get() throws SQLException;
// 
//   static <T> JDBCPropertyAccessor<T> create(JDBCPropertyAccessor<T> accessor) {
//     return create(accessor, null);
//   }
// 
//   static <T> JDBCPropertyAccessor<T> create(JDBCPropertyAccessor<T> accessor, T fallbackIfUnsupported) {
//     return () -> {
//       try {
//         return accessor.get();
//       } catch (SQLFeatureNotSupportedException e) {
//         LOG.debug("Unsupported access properties in SQL metadata", e);
//         return fallbackIfUnsupported;
//       }
//     };
//   }
// 
//   static JDBCPropertyAccessor<Integer> jdbcType(JDBCPropertyAccessor<Integer> accessor) {
//     return create(accessor, JDBCType.OTHER.getVendorTypeNumber());
//   }
// 
// }


import io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor;
import io.vertx.jdbcclient.impl.actions.JDBCPropertyAccessor;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
/*
 * Copyright (c) 2011-2014 The original author or authors
 * ------------------------------------------------------
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Apache License v2.0 which accompanies this distribution.
 *
 *     The Eclipse Public License is available at
 *     http://www.eclipse.org/legal/epl-v10.html
 *
 *     The Apache License v2.0 is available at
 *     http://www.opensource.org/licenses/apache2.0.php
 *
 * You may elect to redistribute this code under either of these licenses.
 */

package io.vertx.ext.jdbc.spi;



/**
 * A shortcut provider that get a column information in the runtime SQL result or parameter metadata
 *
 * @since 4.2.2
 */
@FunctionalInterface
public interface JDBCColumnDescriptorProvider {

  /**
   * Create provider by parameter statement
   *
   * @param statement the prepared statement
   * @return a new {@code JDBCTypeProvider} instance
   * @see java.sql.PreparedStatement
   */
  static JDBCColumnDescriptorProvider fromParameter(PreparedStatement statement) {
// Path: src/main/java/io/vertx/jdbcclient/impl/actions/JDBCColumnDescriptor.java
// public class JDBCColumnDescriptor implements ColumnDescriptor {
// 
//   private final String columnLabel;
//   private final JDBCTypeWrapper jdbcTypeWrapper;
// 
//   private JDBCColumnDescriptor(String columnLabel, JDBCTypeWrapper jdbcTypeWrapper) {
//     this.columnLabel = columnLabel;
//     this.jdbcTypeWrapper = jdbcTypeWrapper;
//   }
// 
//   @Override
//   public String name() {
//     return columnLabel;
//   }
// 
//   @Override
//   public boolean isArray() {
//     return jdbcType() == JDBCType.ARRAY;
//   }
// 
//   @Override
//   public String typeName() {
//     return jdbcTypeWrapper.vendorTypeName();
//   }
// 
//   /**
//    * Use {@link #jdbcTypeWrapper()} when converting an advanced data type depending on the specific database
//    *
//    * @return the most appropriate {@code JDBCType} or {@code null} if it is advanced type of specific database
//    */
//   @Override
//   public JDBCType jdbcType() {
//     return jdbcTypeWrapper.jdbcType();
//   }
// 
//   /**
//    * @return the jdbc type wrapper
//    * @see JDBCTypeWrapper
//    */
//   public JDBCTypeWrapper jdbcTypeWrapper() {
//     return this.jdbcTypeWrapper;
//   }
// 
//   @Override
//   public String toString() {
//     return "JDBCColumnDescriptor[columnName=(" + columnLabel + "), jdbcTypeWrapper=(" + jdbcTypeWrapper + ")]";
//   }
// 
//   public static JDBCColumnDescriptor create(JDBCPropertyAccessor<String> columnLabel,
//                                             JDBCPropertyAccessor<Integer> vendorTypeNumber,
//                                             JDBCPropertyAccessor<String> vendorTypeName,
//                                             JDBCPropertyAccessor<String> vendorTypeClassName) throws SQLException {
//     return new JDBCColumnDescriptor(columnLabel.get(), JDBCTypeWrapper.of(vendorTypeNumber.get(), vendorTypeName.get(),
//       vendorTypeClassName.get()));
//   }
// 
//   public static JDBCColumnDescriptor wrap(JDBCType jdbcType) {
//     return new JDBCColumnDescriptor(null, JDBCTypeWrapper.of(jdbcType));
//   }
// 
// }
// 
// Path: src/main/java/io/vertx/jdbcclient/impl/actions/JDBCPropertyAccessor.java
// public interface JDBCPropertyAccessor<T> {
// 
//   Logger LOG = LoggerFactory.getLogger(JDBCColumnDescriptor.class);
// 
//   T get() throws SQLException;
// 
//   static <T> JDBCPropertyAccessor<T> create(JDBCPropertyAccessor<T> accessor) {
//     return create(accessor, null);
//   }
// 
//   static <T> JDBCPropertyAccessor<T> create(JDBCPropertyAccessor<T> accessor, T fallbackIfUnsupported) {
//     return () -> {
//       try {
//         return accessor.get();
//       } catch (SQLFeatureNotSupportedException e) {
//         LOG.debug("Unsupported access properties in SQL metadata", e);
//         return fallbackIfUnsupported;
//       }
//     };
//   }
// 
//   static JDBCPropertyAccessor<Integer> jdbcType(JDBCPropertyAccessor<Integer> accessor) {
//     return create(accessor, JDBCType.OTHER.getVendorTypeNumber());
//   }
// 
// }


// Path: src/main/java/io/vertx/ext/jdbc/spi/JDBCColumnDescriptorProvider.java
import io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor;
import io.vertx.jdbcclient.impl.actions.JDBCPropertyAccessor;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

/*
 * Copyright (c) 2011-2014 The original author or authors
 * ------------------------------------------------------
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Apache License v2.0 which accompanies this distribution.
 *
 *     The Eclipse Public License is available at
 *     http://www.eclipse.org/legal/epl-v10.html
 *
 *     The Apache License v2.0 is available at
 *     http://www.opensource.org/licenses/apache2.0.php
 *
 * You may elect to redistribute this code under either of these licenses.
 */

package io.vertx.ext.jdbc.spi;



/**
 * A shortcut provider that get a column information in the runtime SQL result or parameter metadata
 *
 * @since 4.2.2
 */
@FunctionalInterface
public interface JDBCColumnDescriptorProvider {

  /**
   * Create provider by parameter statement
   *
   * @param statement the prepared statement
   * @return a new {@code JDBCTypeProvider} instance
   * @see java.sql.PreparedStatement
   */
  static JDBCColumnDescriptorProvider fromParameter(PreparedStatement statement) {
    return col -> JDBCColumnDescriptor.create(() -> null,