Java SQL ResultSet Read getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs)

Here you can find the source of getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs)

Description

get Best Row Id

License

Apache License

Declaration

public static void getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs)
            throws SQLException 

Method Source Code


//package com.java2s;
/*//from w  w w.  j  a  v  a  2  s .  c om
    
   Derby - Class org.apache.derbyTesting.functionTests.tests.store.metadataHelperProcs
    
   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.
    
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    public static void getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs)
            throws SQLException {
        Connection conn = DriverManager.getConnection("jdbc:default:connection");
        boolean tf = true;
        if (nullable.equals("false"))
            tf = false;
        rs[0] = conn.getMetaData().getBestRowIdentifier(null, schema.trim(), tableName.trim(), scope, tf);
    }
}

Related

  1. getArray(ResultSet rs, int index)
  2. getArray(ResultSet rs, String columnName, Class cls)
  3. getArrayAsSet(ResultSet rs, String columnLabel)
  4. getArrayFromResultSet(ResultSet rs, String field)
  5. getAsString(ResultSet res, String field)
  6. getBigInteger(ResultSet resultSet, int columnIndex)
  7. getBigIntegerFromResultSet(ResultSet rs, String db_name)
  8. getBigObject(ResultSet set, int columnIndex)
  9. getCalendar(ResultSet resultSet, String columnName)