db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DerbyNovice <clars...@ureason.com>
Subject Re: Statement/PreparedStatement performance difference and problem
Date Tue, 08 Apr 2008 17:18:25 GMT

Hi,

I have created a small program that demonstrates the issue of the unprepared
statement
being magnitudes faster due to the prepared statement using a table scan.
It uses a fake (but identical) db  and creates and loads fictive data. It
takes about 5 min
to run on my humble laptop.

Thanks for looking into this !

Change the name of the DB before running please.


JAVA PROGRAM BELOW
===================================================================
/*
  Derby - Class UrProva

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.PreparedStatement;
import java.sql.ResultSetMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import java.util.ArrayList;
import java.util.Properties;
import java.util.Vector;
import java.util.Random;
import java.math.BigInteger;


/**
 * <p>
 * This sample program is a minimal Java application showing JDBC access to
a
 * Derby database.</p>
 * <p>
 * Instructions for how to run this program are
 * given in  example.html example.html , by default located in the
 * same directory as this source file
($DERBY_HOME/demo/programs/simple/).</p>
 * <p>
 * Derby applications can run against Derby running in an embedded
 * or a client/server framework.</p>
 * <p>
 * When Derby runs in an embedded framework, the JDBC application and Derby
 * run in the same Java Virtual Machine (JVM). The application
 * starts up the Derby engine.</p>
 * <p>
 * When Derby runs in a client/server framework, the application runs in a
 * different JVM from Derby. The application only needs to load the client
 * driver, and the connectivity framework (in this case the Derby Network
 * Server) provides network connections.</p>
 */
public class UrProva
{
    /* the default framework is embedded*/
    private String framework = "embedded";
    private String driver    = "org.apache.derby.jdbc.EmbeddedDriver";
    private String protocol  = "jdbc:derby:";
    static Connection conn = null;
    static String RANSTR =
"QAa0bcLdUK2eHfJgTP8XhiFj61DOklNm9nBoI5pGqYVrs3CtSuMZvwWx4yE7zR";

    /**
     * <p>
     * Starts the demo by creating a new instance of this class and running
     * the <code>go()</code> method.</p>
     * <p>
     * When you run this application, you may give one of the following
     * arguments:
     *  <ul>
     <li><code>embedded</code> - default, if none specified. Will use
     *        Derby's embedded driver. This driver is included in the
derby.jar
     *        file.</li>
     *    <li><code>derbyclient</code> - will use the Derby client driver
to
     *        access the Derby Network Server. This driver is included in
the
     *        derbyclient.jar file.</li>
     *    <li><code>jccjdbcclient</code> - will use the DB2 Universal JDBC
     *        network client driver, also known as JCC, to access the
Network
     *        Server. This driver is not part of the Derby
distribution.</li>
     *  </ul>
     * <p>
     * When you are using a client/server framework, the network server must
     * already be running when trying to obtain client connections to Derby.
     * This demo program will will try to connect to a network server on
this
     * host (the localhost), see the <code>protocol</code> instance
variable.
     * </p>
     * <p>
     * When running this demo, you must include the correct driver in the
     * classpath of the JVM. See  example.html example.html  for
     * details.
     * </p>
     * @param args This program accepts one optional argument specifying
which
     *        connection framework (JDBC driver) to use (see above). The
default
     *        is to use the embedded JDBC driver.
     */
    public static void main(String[] args)
    {
	new UrProva().go(args);
	System.out.println("UrProva finished");
    }

    private Object getData(String dtype, ResultSet rs, int col)
    {
	try
	    {
		if (dtype.equals("java.lang.String"))
		    {
			return rs.getString(col);
		    }
		else if (dtype.equals("java.lang.Integer"))
		    {
			return rs.getInt(col);
		    }
		else if (dtype.equals("java.lang.Long"))
		    {
			return rs.getLong(col);
		    }
		else if (dtype.equals("java.sql.Clob"))
		    {
			return rs.getClob(col);
		    }
		else
		    {
			System.out.println("Unknown type "+dtype);
			return new String("xx");
		    }
	    }
	catch (SQLException sqle)
	    {
		printSQLException(sqle);
	    }
	return null;
    }

  private String randomstring1(int len)
  {
    
    Random RNG = new Random();
    StringBuffer sb = new StringBuffer();
    for( int i= 0; i < len ; i++)
      {
	char c = (char)(RNG.nextInt(Character.MAX_VALUE + 1));
	sb.append(c);
      }
    return sb.toString();
  }
  private String randomstring(int len)
  {
    
    Random RNG = new Random();
    StringBuffer sb = new StringBuffer();
    for( int i= 0; i < len ; i++)
      {
	int ri = RNG.nextInt(RANSTR.length());
	sb.append(RANSTR.charAt(ri));
      }
    return sb.toString();
  }
  
  private void startStat()
  {
    try
      {
	Statement s = conn.createStatement();
	s.executeUpdate("CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
	s.executeUpdate("CALL SYSCS_UTIL.SYSCS_SET_STATISTICS_TIMING(1)");
      }
    catch (SQLException sqle)
      {
	printSQLException(sqle);
      }
    
  }
  
  private void printStat()
  {
    try
      {
	// retrieve query plan and run-time statistics
	Statement s = conn.createStatement();
	ResultSet rs = s.executeQuery("VALUES
SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()");
	
	while(rs.next())
	  {
	    String str = rs.getString(1);
	    System.out.println("Query Plan: " + str);
	  }
      }
    catch (SQLException sqle)
      {
	printSQLException(sqle);
      }
  }
  
  /**
     * <p>
     * Starts the actual demo activities. This includes loading the correct
     * JDBC driver, creating a database by making a connection to Derby,
     * creating a table in the database, and inserting, updating and
retreiving
     * some data. Some of the retreived data is then verified (compared)
against
     * the expected results. Finally, the table is deleted and, if the
embedded
     * framework is used, the database is shut down.</p>
     * <p>
     * Generally, when using a client/server framework, other clients may be
     * (or want to be) connected to the database, so you should be careful
about
     * doing shutdown unless you know that noone else needs to access the
     * database until it is rebooted. That is why this demo will not shut
down
     * the database unless it is running Derby embedded.</p>
     *
     * @param args - Optional argument specifying which framework or JDBC
driver
     *        to use to connect to Derby. Default is the embedded framework,
     *        see the <code>main()</code> method for details.
     * @see #main(String[])
     */
    void go(String[] args)
    {
	/* parse the arguments to determine which framework is desired*/
	parseArguments(args);

	System.out.println("UrProva starting in " + framework + " mode");

	/* load the desired JDBC driver */
	loadDriver();

	/* We will be using Statement and PreparedStatement objects for
         * executing SQL. These objects, as well as Connections and
ResultSets,
         * are resources that should be released explicitly after use, hence
         * the try-catch-finally pattern used below.
         * We are storing the Statement and Prepared statement object
references
         * in an array list for convenience.
         */
	/* This ArrayList usage may cause a warning when compiling this class
         * with a compiler for J2SE 5.0 or newer. We are not using generics
         * because we want the source to support J2SE 1.4.2 environments. */
	ArrayList         statements = new ArrayList(); // list of Statements,
PreparedStatements
	PreparedStatement psInsert   = null;
	PreparedStatement psUpdate   = null;
	Statement         s          = null;
	ResultSet         rs         = null;
	try
	    {
		Properties props = new Properties(); // connection properties
		// providing a user name and password is optional in the embedded
		// and derbyclient frameworks
		//props.put("user", "user1");
		//props.put("password", "user1");
		// No difference props.put("derby.storage.pageCacheSize", "5000");
		props.put("derby.language.logStatementText", "true");
		props.put("derby.language.logQueryPlan", "true");

		/* By default, the schema APP will be used when no username is
		 * provided.
		 * Otherwise, the schema name is the same as the user name (in this
		 * case "user1" or USER1.)
		 *
		 * Note that user authentication is off by default, meaning that any
		 * user can connect to your database using any password. To enable
		 * authentication, see the Derby Developer's Guide.
		 */

		String dbName = "~/projects/derbyprova/derby;create=true";

		/*
		 * This connection specifies create=true in the connection URL to
		 * cause the database to be created when connecting for the first
		 * time. To remove the database, remove the directory derbyDB (the
		 * same as the database name) and its contents.
		 *
		 * The directory derbyDB will be created under the directory that
		 * the system property derby.system.home points to, or the current
		 * directory (user.dir) if derby.system.home is not set.
		 */
		conn = DriverManager.getConnection(protocol + dbName
						   + ";", props);

		System.out.println("Connected to and created database " + dbName);

		// We want to control transactions manually. Autocommit is on by
		// default in JDBC.
		conn.setAutoCommit(true);

		/* Creating a statement object that we can use for running various
		 * SQL statements commands against the database.*/
		//	        s = conn.createStatement();

		s = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
					 ResultSet.CONCUR_READ_ONLY);
		statements.add(s);

 		// Create DB tables
 		int ri = s.executeUpdate("CREATE TABLE \"SA\".\"UDEVENTDATA\" (\"ID\"
VARCHAR(100) NOT NULL, \"DOMAINKEYID\" VARCHAR(100), \"CREATIONTIME\" BIGINT
NOT NULL, \"CLASS\" VARCHAR(32672), \"NAME\" VARCHAR(32672), \"DESCRIPTION\"
VARCHAR(32672), \"SOFTCLASSID\" VARCHAR(100), \"FIELDSXMLDATA\"
CLOB(2147483647), \"SUMMARYMESSAGE\" VARCHAR(32672), \"MAINMESSAGE\"
CLOB(2147483647), \"TAGID\" VARCHAR(32672), \"SEVERITY\" INTEGER,
\"ACKNOWLEDGED\" SMALLINT, \"CLEARED\" SMALLINT, \"SHELVED\" SMALLINT,
\"SOURCE\" VARCHAR(100), \"GENERATEDBY\" VARCHAR(100),
\"SIMULATEDTIMERECORDKEY\" VARCHAR(100), \"ACKTIMESTAMP\" BIGINT,
\"CLEAREDTIMESTAMP\" BIGINT, \"CONSOLEID\" VARCHAR(32672))");
 		// Create Index
 		ri = s.executeUpdate("CREATE INDEX
\"SA\".\"UDSOFTOBJECTDATA_NAME_IDX_UDEVENTDATA\" ON \"SA\".\"UDEVENTDATA\"
(\"NAME\")");
 		ri = s.executeUpdate("CREATE INDEX
\"SA\".\"UDSOFTOBJECTDATA_CREATIONTIME_IDX_UDEVENTDATA\" ON
\"SA\".\"UDEVENTDATA\" (\"CREATIONTIME\")");
 		ri = s.executeUpdate("CREATE INDEX
\"SA\".\"UDSOFTOBJECTDATA_DOMAINKEY_IDX_UDEVENTDATA\" ON
\"SA\".\"UDEVENTDATA\" (\"DOMAINKEYID\")");
 		// Populate DB
		String inserts = "INSERT INTO \"SA\".\"UDEVENTDATA\" (\"ID\",
\"DOMAINKEYID\", \"CREATIONTIME\", \"NAME\") "+
                          "VALUES
('jgfzdfea564vu-kpm','d46chez0v8cdg-c4m',1200269059000,
'0A502F5D-D656-41AB-8398-7DDC6DB56F9F')";
  		int dbrecords=20000;
  		StringBuffer sb = new StringBuffer();
  		String part1="INSERT INTO \"SA\".\"UDEVENTDATA\" (\"ID\",
\"DOMAINKEYID\", \"CREATIONTIME\", \"NAME\") VALUES (";
  		BigInteger a_ct=new BigInteger("1200269059000");
  		BigInteger one=new BigInteger("1");
  		System.out.println("Starting update...");
  		for( int i= 1; i <= dbrecords ; i++)
  		  {
  		    sb.setLength(0);
  		    sb.append(part1);
  		    // id = random
  		    String a_id=randomstring(17);
  		    sb.append("'");
  		    sb.append(a_id);
  		    sb.append("',");
  		    // domainkey=same
  		    String a_domainkeyid="'d46chez0v8cdg-c4m',";
  		    sb.append(a_domainkeyid);
  		    // creationtime = increasing
  		    if ((i % 1000) == 0)
  		      {
  			a_ct=a_ct.add(one);
 			System.out.println( "?#?#? UrProva.java at line: 327 Dbg-out variable
a_ct ["+a_ct+"]" );
  		      }
  		    sb.append(a_ct.toString()+",'");
  		    // name = random
  		    String a_name=randomstring(37);
  		    sb.append(a_name);
  		    sb.append("')");
  		    String is=sb.toString();
  		    //System.out.println( "?#?#? UrProva.java at line: 317 Dbg-out
variable is ["+is+"]" );
  		    ri = s.executeUpdate(is);
  		  }
		
		/*
		  Get the names out from the db and use these to search on
		*/

		
		String selstring = "SELECT Name From SA.UDEVENTDATA  ";

		long beginTiming_ = java.lang.System.currentTimeMillis ();
		rs = s.executeQuery(selstring);
		long endTiming_ = java.lang.System.currentTimeMillis ();
		long elapsed = endTiming_ - beginTiming_;
		System.out.println( "?#?#? UrProva.java at line: 235 Dbg-out variable
elapsed SELECT ["+elapsed+"]" );
	
		int count = 0;
		ResultSetMetaData md = rs.getMetaData();
		int cols = md.getColumnCount();
		System.out.println( "?#?#? UrProva.java at line: 202 Dbg-out variable cols
["+cols+"]" );
		Vector vclass = new Vector();
		for( int i= 1; i <= cols ; i++)
		    {
		      System.out.println( "?#?#? UrProva.java at line: 206 Dbg-out
variable md ["+md.getColumnClassName(i)+"]" );
		      vclass.addElement(md.getColumnClassName(i));
		    } /* end of for( = 0;  < ; ++) */

		Vector rsv   = new Vector();
		while(rs.next())
		    {
			//do something with the result set
			for( int i= 1; i <= cols ; i++)
			    {
				Object o = getData((String)vclass.elementAt(i-1),
						   rs,
						   i);
				rsv.addElement(o);
				//System.out.println( "?#?#? UrProva.java at line: 206 Dbg-out variable
Name ["+o+"]" );
			    } /* end of for( = 0;  < ; ++) */
			count++;
			if (count > 1000)
			    {
				break;
			    }
		    }

		/*
		  We select the rows and verify the results.

		  ALTERNATIVE 1 USING SELECT WITH ? 

		*/


		PreparedStatement ps;
		ps = conn.prepareStatement("SELECT * From SA.UDEVENTDATA  WHERE
DomainKeyId = ? AND CreationTime >=  ? AND Name  > ? ");
		int  zize = rsv.size();
		zize = 10;
		beginTiming_ = java.lang.System.currentTimeMillis ();
		boolean firsttime=true;
		for( int j=0;j<zize;j++ )
		    {
			String s2 = (String)rsv.elementAt(j) ;
			ps.setString(3,(String)s2);
			ps.setString(1,"d46chez0v8cdg-c4m");
			ps.setString(2,"1200269059019");
			startStat();
			beginTiming_ = java.lang.System.currentTimeMillis ();
			rs = ps.executeQuery();
			endTiming_ = java.lang.System.currentTimeMillis ();
			elapsed = endTiming_ - beginTiming_;
			System.out.println( "?#?#? UrProva.java at line: 235 Dbg-out variable
elapsed ALT 1 SELECT ["+elapsed+"]" );
			if (firsttime)
			    {
				vclass.clear();
				firsttime=false;
				md = rs.getMetaData();
				System.out.println( "?#?#? UrProva.java at line: 200 Dbg-out variable md
["+md+"]" );
				cols = md.getColumnCount();
				System.out.println( "?#?#? UrProva.java at line: 202 Dbg-out variable
cols ["+cols+"]" );
				for( int i= 1; i <= cols ; i++)
				    {
					System.out.println( "?#?#? UrProva.java at line: 206 Dbg-out variable
md ["+md.getColumnClassName(i)+"]" );
					vclass.addElement(md.getColumnClassName(i));
				    } /* end of for( = 0;  < ; ++) */
			    }
			 
			count = 0;
			// only scroll rs.setFetchDirection(ResultSet.FETCH_FORWARD);
			beginTiming_ = java.lang.System.currentTimeMillis ();
			while(rs.next())
			    {
				//do something with the result set
				for( int i= 1; i <= cols ; i++)
				    {
					Object o = getData((String)vclass.elementAt(i-1),
							   rs,
							   i);
				    } /* end of for( = 0;  < ; ++) */
				count++;
			    }
			endTiming_ = java.lang.System.currentTimeMillis ();
			if (! firsttime)
			  {
			    printStat();
			  }
			elapsed = endTiming_ - beginTiming_;
			System.out.println( "ALT 1 LOOP NO "+j );
			System.out.println( "?#?#? UrProva.java at line: 235 Dbg-out variable
elapsed ALT 1 NEXT ["+elapsed+"]" );
			System.out.println("Counted "+count+" in resultset");
		    }


		/** ALTERNATIVE 2 USING SELECT WITHOUT ? but prepared string */

		zize = rsv.size();
		zize = 10;
		beginTiming_ = java.lang.System.currentTimeMillis ();
		firsttime=true;
		for( int j=0;j<zize;j++ )
		    {
			String s2 = (String)rsv.elementAt(j) ;
		        String sels = "SELECT * From SA.UDEVENTDATA  WHERE DomainKeyId =
'd46chez0v8cdg-c4m' AND CreationTime >= 1200269059019   AND Name  > '"+s2+"' 
";
			ps = conn.prepareStatement(sels);

			startStat();
			beginTiming_ = java.lang.System.currentTimeMillis ();
			rs = ps.executeQuery();
			endTiming_ = java.lang.System.currentTimeMillis ();
			elapsed = endTiming_ - beginTiming_;
			System.out.println( "?#?#? UrProva.java at line: 235 Dbg-out variable
elapsed SELECT ALT 2 ["+elapsed+"]" );
			if (firsttime)
			    {
				vclass.clear();
				firsttime=false;
				md = rs.getMetaData();
				cols = md.getColumnCount();
				for( int i= 1; i <= cols ; i++)
				    {
					vclass.addElement(md.getColumnClassName(i));
				    } /* end of for( = 0;  < ; ++) */
			    }
			 
			count = 0;
			beginTiming_ = java.lang.System.currentTimeMillis ();
			while(rs.next())
			    {
				//do something with the result set
				for( int i= 1; i <= cols ; i++)
				    {
					Object o = getData((String)vclass.elementAt(i-1),
							   rs,
							   i);
				    } /* end of for( = 0;  < ; ++) */
				count++;
			    }
			endTiming_ = java.lang.System.currentTimeMillis ();
			if (! firsttime)
			  {
			    printStat();
			  }
			elapsed = endTiming_ - beginTiming_;
			System.out.println( "ALT 2 LOOP NO "+j );
			System.out.println( "?#?#? UrProva.java at line: 235 Dbg-out variable
elapsed ALT 2 NEXT ["+elapsed+"]" );
			System.out.println("Counted "+count+" in resultset");
		    }
		


		//ps.close();



 

	
		if (framework.equals("embedded"))
		    {
			try
			    {
				// the shutdown=true attribute shuts down Derby
				//DriverManager.getConnection(protocol + dbName + ";shutdown=true");
				DriverManager.getConnection("jdbc:derby:;shutdown=true");

			    }
			catch (SQLException se)
			    {
				if (( (se.getErrorCode() == 50000)
				      && ("XJ015".equals(se.getSQLState()) ))) {
				    // we got the expected exception
				    System.out.println("Derby shut down normally");
				    // Note that for single database shutdown, the expected
				    // SQL state is "08006", and the error code is 45000.
				} else {
				    // if the error code or SQLState is different, we have
				    // an unexpected exception (shutdown failed)
				    System.err.println("Derby did not shut down normally");
				    printSQLException(se);
				}
			    }
		    }
	    }
	catch (SQLException sqle)
	    {
		printSQLException(sqle);
	    } finally {
	    // release all open resources to avoid unnecessary memory usage

	    // ResultSet
	    try {
		if (rs != null)
		    {
			rs.close();
			rs = null;
		    }
	    } catch (SQLException sqle)
		{
		    printSQLException(sqle);
		}

	    // Statements and PreparedStatements
	    int i = 0;
	    while (!statements.isEmpty())
		{
		    // PreparedStatement extend Statement
		    Statement st = (Statement)statements.remove(i);
		    try {
			if (st != null)
			    {
				st.close();
				st = null;
			    }
		    }
		    catch (SQLException sqle)
			{
			    printSQLException(sqle);
			}
		}

	    //Connection
	    try {
		if (conn != null)
		    {
			conn.close();
			conn = null;
		    }
	    }
	    catch (SQLException sqle)
		{
		    printSQLException(sqle);
		}
	}
    }


  
    /**
     * Loads the appropriate JDBC driver for this environment/framework. For
     * example, if we are in an embedded environment, we load Derby's
     * embedded Driver, <code>org.apache.derby.jdbc.EmbeddedDriver</code>.
     */
    private void loadDriver()
    {
	/*
	 *  The JDBC driver is loaded by loading its class.
	 *  If you are using JDBC 4.0 (Java SE 6) or newer, JDBC drivers may
	 *  be automatically loaded, making this code optional.
	 *
	 *  In an embedded environment, this will also start up the Derby
	 *  engine (though not any databases), since it is not already
	 *  running. In a client environment, the Derby engine is being run
	 *  by the network server framework.
	 *
	 *  In an embedded environment, any static Derby system properties
	 *  must be set before loading the driver to take effect.
	 */
	try
	    {
		Class.forName(driver).newInstance();
		System.out.println("Loaded the appropriate driver");
	    }
	catch (ClassNotFoundException cnfe)
	    {
		System.err.println("\nUnable to load the JDBC driver " + driver);
		System.err.println("Please check your CLASSPATH.");
		cnfe.printStackTrace(System.err);
	    } catch (InstantiationException ie)
	    {
		System.err.println(
				   "\nUnable to instantiate the JDBC driver " + driver);
		ie.printStackTrace(System.err);
	    } catch (IllegalAccessException iae)
	    {
		System.err.println(
				   "\nNot allowed to access the JDBC driver " + driver);
		iae.printStackTrace(System.err);
	    }
    }

    /**
     * Reports a data verification failure to System.err with the given
message.
     *
     * @param message A message describing what failed.
     */
    private void reportFailure(String message)
    {
	System.err.println("\nData verification failed:");
	System.err.println('\t' + message);
    }

    /**
     * Prints details of an SQLException chain to <code>System.err</code>.
     * Details included are SQL State, Error code, Exception message.
     *
     * @param e the SQLException from which to print details.
     */
    public static void printSQLException(SQLException e)

    {
	// Unwraps the entire exception chain to unveil the real cause of the
	// Exception.
	while (e != null)
	    {
		System.err.println("\n----- SQLException -----");
		System.err.println("  SQL State:  " + e.getSQLState());
		System.err.println("  Error Code: " + e.getErrorCode());
		System.err.println("  Message:    " + e.getMessage());
		// for stack traces, refer to derby.log or uncomment this:
		//e.printStackTrace(System.err);
		e = e.getNextException();
	    }
    }

    /**
     * Parses the arguments given and sets the values of this class'
instance
     * variables accordingly - that is which framework to use, the name of
the
     * JDBC driver class, and which connection protocol protocol to use. The
     * protocol should be used as part of the JDBC URL when connecting to
Derby.
     * <p>
     * If the argument is "embedded" or invalid, this method will not change
     * anything, meaning that the default values will be used.</p>
     * <p>
     * @param args JDBC connection framework, either "embedded",
"derbyclient"
     *        or "jccjdbcclient". Only the first argument will be
considered,
     *        the rest will be ignored.
     */
    private void parseArguments(String[] args)

    {
	if (args.length > 0)
	    {
		if (args[0].equalsIgnoreCase("jccjdbcclient"))

		    {
			framework = "jccjdbc";
			driver = "com.ibm.db2.jcc.DB2Driver";
			protocol = "jdbc:derby:net://localhost:1527/";
		    }
		else if (args[0].equalsIgnoreCase("derbyclient"))

		    {
			framework = "derbyclient";
			driver = "org.apache.derby.jdbc.ClientDriver";
			protocol = "jdbc:derby://localhost:1527/";
		    }
	    }
    }
}

===================================================================
-- 
View this message in context: http://www.nabble.com/Statement-PreparedStatement-performance-difference-and-problem-tp16537511p16568037.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message