Here you can find the source of formatLogParam(Array obj)
Parameter | Description |
---|---|
obj | to print |
private static String formatLogParam(Array obj)
//package com.java2s; /**// w w w . ja v a2 s . c om * Copyright 2010 Wallace Wadge * * 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.sql.Array; import java.sql.Blob; import java.sql.Clob; import java.sql.Ref; import java.sql.SQLException; public class Main { /** Formatter for debugging purposes only. * @param obj to print * @return String */ private static String formatLogParam(Blob obj) { String result = ""; try { result = "(blob of length " + obj.length() + ")"; } catch (SQLException e) { result = "(blob of unknown length)"; } return result; } /** Formatter for debugging purposes only. * @param obj to print * @return String */ private static String formatLogParam(Clob obj) { String result = ""; try { result = "(cblob of length " + obj.length() + ")"; } catch (SQLException e) { result = "(cblob of unknown length)"; } return result; } /** Formatter for debugging purposes only. * @param obj to print * @return String */ private static String formatLogParam(Array obj) { String result = ""; try { result = "(array of type" + obj.getBaseTypeName().length() + ")"; } catch (SQLException e) { result = "(array of unknown type)"; } return result; } /** Formatter for debugging purposes only. * @param obj to print * @return String */ private static String formatLogParam(Ref obj) { String result = ""; try { result = "(ref of type" + obj.getBaseTypeName().length() + ")"; } catch (SQLException e) { result = "(ref of unknown type)"; } return result; } }