db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r443167 - in /db/derby/code/trunk: bin/derby_common.sh tools/jdbc4/ tools/jdbc4/client.list tools/jdbc4/engine.list tools/jdbc4/update-with-jdbc4 tools/jdbc4/update-with-jdbc4.bat
Date Wed, 13 Sep 2006 23:38:50 GMT
Author: fuzzylogic
Date: Wed Sep 13 16:38:49 2006
New Revision: 443167

URL: http://svn.apache.org/viewvc?view=rev&rev=443167
Log:
DERBY-1846: Add a script that allows users to easily update their Derby jars
with the JDBC4 classes. Also a minor edit to derby_common.sh which prevents
a warning on Linux.

Added:
    db/derby/code/trunk/tools/jdbc4/
    db/derby/code/trunk/tools/jdbc4/client.list   (with props)
    db/derby/code/trunk/tools/jdbc4/engine.list   (with props)
    db/derby/code/trunk/tools/jdbc4/update-with-jdbc4   (with props)
    db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat   (with props)
Modified:
    db/derby/code/trunk/bin/derby_common.sh

Modified: db/derby/code/trunk/bin/derby_common.sh
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/bin/derby_common.sh?view=diff&rev=443167&r1=443166&r2=443167
==============================================================================
--- db/derby/code/trunk/bin/derby_common.sh (original)
+++ db/derby/code/trunk/bin/derby_common.sh Wed Sep 13 16:38:49 2006
@@ -162,9 +162,8 @@
 fi
 
 # Readjust classpath for MKS
-if [ ! `expr index` = "index" ]; then 
-  if [ `expr index $SHELL sh.exe` -gt 0 ]; then
-    LOCALCLASSPATH=`echo $LOCALCLASSPATH | sed -E 's/([\d\w]*):([\d\w]*)/\1;\2/g
+# expr match 
+if [ \( "`expr $SHELL : '.*sh.exe$'`" -gt 0 \) -a \( "$cygwin" = "false" \) ]; then
+  LOCALCLASSPATH=`echo $LOCALCLASSPATH | sed -E 's/([\d\w]*):([\d\w]*)/\1;\2/g
 '`
-  fi
 fi

Added: db/derby/code/trunk/tools/jdbc4/client.list
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/client.list?view=auto&rev=443167
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/client.list (added)
+++ db/derby/code/trunk/tools/jdbc4/client.list Wed Sep 13 16:38:49 2006
@@ -0,0 +1,17 @@
+org\apache\derby\client\ClientPooledConnection40.java
+org\apache\derby\client\ClientXAConnection40.java
+org\apache\derby\client\am\CallableStatement40.java
+org\apache\derby\client\am\ColumnMetaData40.java
+org\apache\derby\client\am\FailedProperties40.java
+org\apache\derby\client\am\LogicalConnection40.java
+org\apache\derby\client\am\ParameterMetaData40.java
+org\apache\derby\client\am\PreparedStatement40.java
+org\apache\derby\client\am\SQLExceptionFactory40.java
+org\apache\derby\client\am\Statement40.java
+org\apache\derby\client\net\ClientJDBCObjectFactoryImpl40.java
+org\apache\derby\client\net\NetConnection40.java
+org\apache\derby\client\net\NetDatabaseMetaData40.java
+org\apache\derby\client\net\NetResultSet40.java
+org\apache\derby\jdbc\ClientConnectionPoolDataSource40.java
+org\apache\derby\jdbc\ClientDataSource40.java
+org\apache\derby\jdbc\ClientXADataSource40.java

Propchange: db/derby/code/trunk/tools/jdbc4/client.list
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: db/derby/code/trunk/tools/jdbc4/engine.list
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/engine.list?view=auto&rev=443167
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/engine.list (added)
+++ db/derby/code/trunk/tools/jdbc4/engine.list Wed Sep 13 16:38:49 2006
@@ -0,0 +1,20 @@
+org\apache\derby\iapi\jdbc\BrokeredCallableStatement40.java
+org\apache\derby\iapi\jdbc\BrokeredConnection40.java
+org\apache\derby\iapi\jdbc\BrokeredPreparedStatement40.java
+org\apache\derby\iapi\jdbc\BrokeredStatement40.java
+org\apache\derby\iapi\jdbc\FailedProperties40.java
+org\apache\derby\impl\jdbc\EmbedCallableStatement40.java
+org\apache\derby\impl\jdbc\EmbedConnection40.java
+org\apache\derby\impl\jdbc\EmbedDatabaseMetaData40.java
+org\apache\derby\impl\jdbc\EmbedParameterMetaData40.java
+org\apache\derby\impl\jdbc\EmbedPreparedStatement40.java
+org\apache\derby\impl\jdbc\EmbedResultSet40.java
+org\apache\derby\impl\jdbc\EmbedResultSetMetaData40.java
+org\apache\derby\impl\jdbc\EmbedStatement40.java
+org\apache\derby\impl\jdbc\SQLExceptionFactory40.java
+org\apache\derby\jdbc\Driver40.java
+org\apache\derby\jdbc\EmbedPooledConnection40.java
+org\apache\derby\jdbc\EmbedXAConnection40.java
+org\apache\derby\jdbc\EmbeddedConnectionPoolDataSource40.java
+org\apache\derby\jdbc\EmbeddedDataSource40.java
+org\apache\derby\jdbc\EmbeddedXADataSource40.java

Propchange: db/derby/code/trunk/tools/jdbc4/engine.list
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/update-with-jdbc4?view=auto&rev=443167
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/update-with-jdbc4 (added)
+++ db/derby/code/trunk/tools/jdbc4/update-with-jdbc4 Wed Sep 13 16:38:49 2006
@@ -0,0 +1,134 @@
+#!/bin/sh
+
+if [ -n "$update_jdbc4_debug" ]; then
+  set -x
+fi
+
+# Check location
+if [ ! -d ../../java/engine ]; then
+  echo "Could not locate the source code for the Derby engine."
+  echo "Please run this script from inside the tools/jdbc4 directory."
+  exit 1
+fi
+
+THISDIR=`pwd`
+SRCDIR=`cd ../.. && pwd`
+
+# Check environment variables
+if [ -z "$DERBY_HOME" ]; then
+  echo "Please set DERBY_HOME to the location of your Derby installation."
+  exit 1
+fi
+
+if [ ! -f "$DERBY_HOME/lib/derby.jar" -a -f "$DERBY_HOME/lib/derbyclient.jar" ]; then
+  echo "Could not find the Derby jars in \$DERBY_HOME/lib"
+  exit 1
+fi
+
+case "`uname`" in 
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true ;;
+esac
+
+if [ -z "$JAVA_HOME" ]; then
+  if [ -n "$darwin" ]; then
+    JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+  fi else if [ -d /usr/j2se -a -x /usr/j2se/bin/javac ]; then
+    JAVA_HOME=/usr/j2se
+  fi
+fi
+
+if [ ! -x "$JAVA_HOME/bin/javac" ]; then
+  echo "Could not find a Java compiler at \$JAVA_HOME/bin/javac."
+  echo "Check the setting of the JAVA_HOME environment variable."
+  exit 1
+fi
+
+# Check that the JVM version is 1.6.0  
+"$JAVA_HOME/bin/java" -version 2> java.version
+VERSION=`head -1 java.version | sed 's/java version "//g' | sed 's/[-_].*$//g'`
+if [ `expr $VERSION : 1.6.0` -eq 0 ]; then
+  echo "The JVM in \$JAVA_HOME is not version 1.6.0"
+  echo "To use this script to compile the JDBC 4.0 Derby classes,"
+  echo "you need a 1.6.0 level VM"
+  exit 1
+fi
+
+# Set up LOCALCLASSPATH, for cygwin or mks, use ;
+CPS=:
+if [ -n "$cygwin" ]; then
+  CPS=';'
+fi
+if [ ! `expr index` = "index" ]; then  # for MKS
+  if [ `expr index $SHELL sh.exe` -gt 0 ]; then
+    CPS=';'
+  fi
+fi
+LOCALCLASSPATH="$DERBY_HOME/lib/derby.jar$CPS$DERBY_HOME/lib/derbyclient.jar"
+
+# compile the client classes
+echo "Compiling the client classes for JDBC 4.0"
+for i in `cat client.list`
+do
+  FILE=`echo $i | tr '\\' '/'`
+  CLASSES="$FILE $CLASSES"
+done
+
+cd $SRCDIR/java/client
+mkdir -p "$DERBY_HOME/jdbc4classes/client"
+"$JAVA_HOME/bin/javac" -d "$DERBY_HOME/jdbc4classes/client" \
+                       -cp "$LOCALCLASSPATH" \
+                       -sourcepath "$SRCDIR/java/client$CPS$SRCDIR/java/shared" \
+                        $CLASSES
+
+if [ $? -gt 0 ]; then
+  echo "There was an error compiling the client classes. Exiting."
+  cd "$THISDIR"
+  exit 1
+fi
+
+cd $THISDIR
+
+echo "Updating derbyclient.jar"
+jar uf "$DERBY_HOME/lib/derbyclient.jar" -C "$DERBY_HOME/jdbc4classes/client" org
+
+if [ $? -gt 0 ]; then
+  echo "Error updating derbyclient.jar. It may no longer be usable."
+  exit 1
+fi
+
+# compile the engine classes
+echo "Compiling the engine classes for JDBC 4.0"
+unset CLASSES
+for i in `cat engine.list`
+do
+  FILE=`echo $i | tr '\\' '/'`
+  CLASSES="$FILE $CLASSES"
+done
+
+cd "$SRCDIR/java/engine"  
+mkdir -p "$DERBY_HOME/jdbc4classes/engine"
+"$JAVA_HOME/bin/javac" -d "$DERBY_HOME/jdbc4classes/engine" \
+                       -cp "$LOCALCLASSPATH" \
+                       -sourcepath "$SRCDIR/java/engine$CPS$SRCDIR/java/shared" \
+                        $CLASSES
+
+if [ $? -gt 0 ]; then
+  echo "There was an error compiling the engine classes. Exiting."
+  cd "$THISDIR"
+  exit 1
+fi
+
+cd "$THISDIR"
+
+echo "Updating derby.jar"
+jar uf "$DERBY_HOME/lib/derby.jar" -C "$DERBY_HOME/jdbc4classes/engine" org
+
+if [ $? -gt 0 ]; then
+  echo "Error updating derby.jar. It may no longer be usable."
+  exit 1
+fi
+
+# cleanup
+rm -r "$DERBY_HOME/jdbc4classes"
+rm "$THISDIR/java.version"

Propchange: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4
------------------------------------------------------------------------------
    svn:eol-style = LF

Propchange: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4
------------------------------------------------------------------------------
    svn:executable = *

Added: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat?view=auto&rev=443167
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat (added)
+++ db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat Wed Sep 13 16:38:49 2006
@@ -0,0 +1,70 @@
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+
+@REM   http://www.apache.org/licenses/LICENSE-2.0
+
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+
+rem %~dp0 is expanded pathname of the current script under NT
+set SRCDIR=%~dp0..\..
+set THISDIR=%~dp0
+for %%A in ("%SRCDIR%\java\shared") do set SHAREDDIR=%%~dpfA
+for %%A in ("%SRCDIR%\java\engine") do set ENGINEDIR=%%~dpfA
+for %%A in ("%SRCDIR%\java\client") do set CLIENTDIR=%%~dpfA
+
+rem check the value of DERBY_HOME
+if exist "%DERBY_HOME%\lib\derby.jar" goto setLocalClassPath
+
+:noDerbyHome
+echo DERBY_HOME is set incorrectly or derby.jar could not be located. Please set DERBY_HOME.
+goto end
+
+:setLocalClasspath
+set LOCALCLASSPATH=%DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbyclient.jar
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\javac.exe
+if "%_JARCMD%" == "" set _JARCMD=%JAVA_HOME%\bin\jar.exe
+goto endcheck
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=javac.exe
+if "%_JARCMD%" == "" set _JAVACMD=jar.exe
+
+:endcheck
+echo "Building Derby client classes for JDBC 4.0"
+mkdir %DERBY_HOME%\jdbc4classes\client
+cd %SRCDIR%\java\client
+FOR /F %%G in (%THISDIR%client.list) do %_JAVACMD% -d %DERBY_HOME%\jdbc4classes\client -classpath
%LOCALCLASSPATH% -sourcepath "%CLIENTDIR%;%ENGINEDIR%;%SHAREDDIR%" %%G
+
+echo "Updating %DERBY_HOME%\lib\derbyclient.jar"
+%_JARCMD% uf %DERBY_HOME%\lib\derbyclient.jar -C %DERBY_HOME%\jdbc4classes\client org
+
+echo "Building Derby engine classes for JDBC 4.0"
+mkdir %DERBY_HOME%\jdbc4classes\engine
+cd %SRCDIR%\java\engine
+FOR /F %%G in (%THISDIR%engine.list) do %_JAVACMD% -d %DERBY_HOME%\jdbc4classes\engine -classpath
%LOCALCLASSPATH% -sourcepath "%ENGINEDIR%;%SHAREDDIR%" %%G
+
+echo "Updating %DERBY_HOME%\lib\derby.jar"
+%_JARCMD% uf %DERBY_HOME%\lib\derby.jar -C %DERBY_HOME%\jdbc4classes\engine org
+
+cd %THISDIR%
+
+echo "Cleaning up"
+@erase /s /q %DERBY_HOME%/jdbc4classes
+echo "Done."
+:end

Propchange: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Propchange: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message