Java SQL Type findMethod(Class returnType, Class parameterType)

Here you can find the source of findMethod(Class returnType, Class parameterType)

Description

find Method

License

Apache License

Declaration

private static Method findMethod(Class<?> returnType, Class<?> parameterType) 

Method Source Code

//package com.java2s;
/*/* w  w w .j  ava 2s.  c  o m*/
 * Copyright 2007-2012 Jiemamy Project and the Others.
 * Created on 2009/04/14
 *
 * This file is part of Jiemamy.
 *
 * Licensed 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.
 */

import java.lang.reflect.Method;
import java.sql.ResultSet;

public class Main {
    private static Method findMethod(Class<?> returnType, Class<?> parameterType) {
        for (Method method : ResultSet.class.getMethods()) {
            Class<?>[] parameterTypes = method.getParameterTypes();
            if (parameterTypes.length == 1 && parameterTypes[0].equals(parameterType)
                    && returnType.equals(method.getReturnType()) && method.getName().startsWith("get")) {
                return method;
            }
        }
        return null;
    }
}

Related

  1. deleteFromAllTables(Connection con)
  2. deserializeSQLTypesToJava(String sqltypename, String value)
  3. dumpTypes(Connection pConnection)
  4. extractConstant(String typeName)
  5. fillLogParams(String sql, Map logParams)
  6. getAntipodeForFunction(String base, int destType)
  7. getArgTypes()
  8. getAsciiStream(Object value, int columnType)
  9. getBinary(Object value, int columnType)