2740N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2740N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2740N/A * This code is free software; you can redistribute it and/or modify it 2740N/A * under the terms of the GNU General Public License version 2 only, as 2740N/A * published by the Free Software Foundation. Oracle designates this 2740N/A * particular file as subject to the "Classpath" exception as provided 2740N/A * by Oracle in the LICENSE file that accompanied this code. 2740N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2740N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2740N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2740N/A * version 2 for more details (a copy is included in the LICENSE file that 2740N/A * You should have received a copy of the GNU General Public License version 2740N/A * 2 along with this work; if not, write to the Free Software Foundation, 2740N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2740N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2740N/A * or visit www.oracle.com if you need additional information or have any 2740N/A * A factory API that enables applications to obtain a 2740N/A * {@code RowSetFactory} implementation that can be used to create different 2740N/A * types of {@code RowSet} implementations. 2740N/A * RowSetFactory aFactory = RowSetProvider.newFactory(); 2740N/A * CachedRowSet crs = aFactory.createCachedRowSet(); 2740N/A * RowSetFactory rsf = RowSetProvider.newFactory("com.sun.rowset.RowSetFactoryImpl", null); 2740N/A * WebRowSet wrs = rsf.createWebRowSet(); 2740N/A * Tracing of this class may be enabled by setting the System property 2740N/A * {@code javax.sql.rowset.RowSetFactory.debug} to any value but {@code false}. 2740N/A // Check to see if the debug property is set 2740N/A // Allow simply setting the prop to turn on debug 2740N/A * <p>Creates a new instance of a <code>RowSetFactory</code> 2740N/A * implementation. This method uses the following 2740N/A * look up order to determine 2740N/A * the <code>RowSetFactory</code> implementation class to load:</p> 2798N/A * The System property {@code javax.sql.rowset.RowSetFactory}. For example: 2798N/A * -Djavax.sql.rowset.RowSetFactory=com.sun.rowset.RowSetFactoryImpl 2815N/A * The {@link ServiceLoader} API. The {@code ServiceLoader} API will look 2815N/A * for a class name in the file 2740N/A * in jars available to the runtime. For example, to have the the RowSetFactory 2740N/A * implementation {@code com.sun.rowset.RowSetFactoryImpl } loaded, the 2740N/A * {@code com.sun.rowset.RowSetFactoryImpl } 2740N/A * Platform default <code>RowSetFactory</code> instance. 2740N/A * <p>Once an application has obtained a reference to a {@code RowSetFactory}, 2740N/A * it can use the factory to obtain RowSet instances.</p> 2740N/A * @return New instance of a <code>RowSetFactory</code> 2740N/A * @throws SQLException if the default factory class cannot be loaded, 2740N/A * instantiated. The cause will be set to actual Exception 2740N/A // Use the system property first 2740N/A // Check to see if we found the RowSetFactory via a System property 2740N/A // If the RowSetFactory is not found via a System Property, now 2740N/A // look it up via the ServiceLoader API and if not found, use the 2740N/A * <p>Creates a new instance of a <code>RowSetFactory</code> from the 2740N/A * specified factory class name. 2740N/A * This function is useful when there are multiple providers in the classpath. 2740N/A * It gives more control to the application as it can specify which provider 2740N/A * <p>Once an application has obtained a reference to a <code>RowSetFactory</code> 2740N/A * it can use the factory to obtain RowSet instances.</p> 2740N/A * @param factoryClassName fully qualified factory class name that 2740N/A * provides an implementation of <code>javax.sql.rowset.RowSetFactory</code>. 2740N/A * @param cl <code>ClassLoader</code> used to load the factory 2740N/A * class. If <code>null</code> current <code>Thread</code>'s context 2740N/A * classLoader is used to load the factory class. 2740N/A * @return New instance of a <code>RowSetFactory</code> 2740N/A * @throws SQLException if <code>factoryClassName</code> is 2740N/A * <code>null</code>, or the factory class cannot be loaded, instantiated. 2740N/A * Returns the class loader to be used. 2740N/A * @return The ClassLoader to use. 2740N/A * Attempt to load a class using the class loader supplied. If that fails 2740N/A * and fall back is enabled, the current (i.e. bootstrap) class loader is 2740N/A * If the class loader supplied is <code>null</code>, first try using the 2740N/A * context class loader followed by the current class loader. 2740N/A * @return The class which was loaded 2740N/A // Use current class loader 2740N/A * Use the ServiceLoader mechanism to load the default RowSetFactory 2740N/A * @return default RowSetFactory Implementation 2881N/A "RowSetFactory: Error locating RowSetFactory using Service " 2740N/A * Returns the requested System Property. If a {@code SecurityException} 2798N/A * @param propName - System property to retrieve 2740N/A * @return The System property value or NULL if the property does not exist 2740N/A * or a {@code SecurityException} occurs. 2740N/A * Debug routine which will output tracing if the System Property 2740N/A * -Djavax.sql.rowset.RowSetFactory.debug is set 2740N/A * @param msg - The debug message to display