Here you can find the source of getColumns(Connection connection, String name)
public static ResultSet getColumns(Connection connection, String name) throws SQLException
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 SAP and others.//ww w . j a v a 2s . c om * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * Contributors: * SAP - initial API and implementation *******************************************************************************/ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static ResultSet getColumns(Connection connection, String name) throws SQLException { DatabaseMetaData meta = connection.getMetaData(); if (name == null) { meta.getColumns(null, null, name, null); } ResultSet columns = meta.getColumns(null, null, name, null); if (columns.next()) { return meta.getColumns(null, null, name, null); } else { columns = meta.getColumns(null, null, name.toLowerCase(), null); if (columns.next()) { return meta.getColumns(null, null, name.toLowerCase(), null); } else { columns = meta.getColumns(null, null, name.toUpperCase(), null); // if (columns.next()) { // return meta.getColumns(null, null, name.toUpperCase(), null); // } } } return columns; } }