1.1 --- a/distributions/debian/build.sh Sat May 16 20:13:43 2015 +0200
1.2 +++ b/distributions/debian/build.sh Sat May 16 20:25:16 2015 +0200
1.3 @@ -51,7 +51,7 @@
1.4 Package: sql-dk
1.5 Version: $VERSION
1.6 Maintainer: $NAME
1.7 -Depends: java7-runtime-headless | java7-runtime
1.8 +Depends: java7-runtime-headless | java7-runtime | java8-runtime-headless | java8-runtime
1.9 Suggests: libpostgresql-jdbc-java,libmysql-java
1.10 Copyright: $COPYRIGHT_FILE
1.11 Extra-Files: config.xsd, config.rnc, config.xsl
2.1 --- a/distributions/fedora/build.sh Sat May 16 20:13:43 2015 +0200
2.2 +++ b/distributions/fedora/build.sh Sat May 16 20:25:16 2015 +0200
2.3 @@ -1,6 +1,22 @@
2.4 #!/bin/bash
2.5
2.6 -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2.7 +# SQL-DK
2.8 +# Copyright © 2014 František Kučera (frantovo.cz)
2.9 +#
2.10 +# This program is free software: you can redistribute it and/or modify
2.11 +# it under the terms of the GNU General Public License as published by
2.12 +# the Free Software Foundation, either version 3 of the License, or
2.13 +# (at your option) any later version.
2.14 +#
2.15 +# This program is distributed in the hope that it will be useful,
2.16 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2.17 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.18 +# GNU General Public License for more details.
2.19 +#
2.20 +# You should have received a copy of the GNU General Public License
2.21 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
2.22 +
2.23 +DIR="$( cd "$( dirname "$0" )" && pwd )"
2.24 TOPDIR="$DIR/TMP";
2.25 DBPATH="$DIR/TMP/RPMDB";
2.26
2.27 @@ -12,4 +28,4 @@
2.28 -bb \
2.29 "$DIR/sql-dk.spec";
2.30
2.31 -cp "$TOPDIR"/RPMS/*/sql-dk-*.rpm .
2.32 +cp "$TOPDIR"/RPMS/*/sql-dk-*.rpm $DIR/
3.1 --- a/distributions/fedora/sql-dk.spec Sat May 16 20:13:43 2015 +0200
3.2 +++ b/distributions/fedora/sql-dk.spec Sat May 16 20:25:16 2015 +0200
3.3 @@ -1,10 +1,62 @@
3.4 +# SQL-DK
3.5 +# Copyright © 2014 František Kučera (frantovo.cz)
3.6 +#
3.7 +# This program is free software: you can redistribute it and/or modify
3.8 +# it under the terms of the GNU General Public License as published by
3.9 +# the Free Software Foundation, either version 3 of the License, or
3.10 +# (at your option) any later version.
3.11 +#
3.12 +# This program is distributed in the hope that it will be useful,
3.13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3.14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.15 +# GNU General Public License for more details.
3.16 +#
3.17 +# You should have received a copy of the GNU General Public License
3.18 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
3.19 +
3.20 Name: sql-dk
3.21 Summary: SQL batch client
3.22 +Group: Applications/Databases
3.23 +BuildArch: noarch
3.24 Version: 0.10
3.25 -Release: 1
3.26 +Release: 3
3.27 License: GNU GPLv3+
3.28 -# TODO: Java 7 or Java 8+
3.29 -#Requires: java >= 1:1.7.0
3.30 +URL: https://sql-dk.globalcode.info/
3.31 +#Requires: sql-dk-java = %{version}
3.32 +Requires: /usr/bin/java
3.33 +
3.34 +
3.35 +# --- Dependencies -----------------------------------------------------------
3.36 +# SQL-DK requires Java 7 or Java 8 (or maybe higher).
3.37 +# But simple
3.38 +# Requires: java >= 1:1.7.0
3.39 +# is not working in Fedora 20
3.40 +# because java-1.8.0-openjdk here provides „java8“ not „java“ in version 1.8
3.41 +# see https://www.abclinuxu.cz/poradna/linux/show/396144#1 (in Czech)
3.42 +
3.43 +%package java7
3.44 +Summary: Java 7
3.45 +Group: Development/Languages
3.46 +Requires: java >= 1:1.7.0
3.47 +Provides: sql-dk-java = %{version}
3.48 +
3.49 +%description java7
3.50 +virtual package for dependency on Java 7
3.51 +
3.52 +%files java7
3.53 +
3.54 +%package java8
3.55 +Summary: Java 8
3.56 +Group: Development/Languages
3.57 +Requires: java8 >= 1:1.8.0
3.58 +Provides: sql-dk-java = %{version}
3.59 +
3.60 +%description java8
3.61 +virtual package for dependency on Java 8
3.62 +
3.63 +%files java8
3.64 +# ----------------------------------------------------------------------------
3.65 +
3.66
3.67 %description
3.68 SQL-DK is a command-line client for relational databases.
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/java/jdbc-dk-driver/libs/sql-dk Sat May 16 20:25:16 2015 +0200
4.3 @@ -0,0 +1,1 @@
4.4 +../../sql-dk/src
4.5 \ No newline at end of file
5.1 --- a/java/jdbc-dk-driver/nbproject/build-impl.xml Sat May 16 20:13:43 2015 +0200
5.2 +++ b/java/jdbc-dk-driver/nbproject/build-impl.xml Sat May 16 20:25:16 2015 +0200
5.3 @@ -128,6 +128,7 @@
5.4 <condition property="have.sources">
5.5 <or>
5.6 <available file="${src.dir}"/>
5.7 + <available file="${src.sql-dk.dir}"/>
5.8 </or>
5.9 </condition>
5.10 <condition property="netbeans.home+have.tests">
5.11 @@ -224,6 +225,7 @@
5.12 </target>
5.13 <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
5.14 <fail unless="src.dir">Must set src.dir</fail>
5.15 + <fail unless="src.sql-dk.dir">Must set src.sql-dk.dir</fail>
5.16 <fail unless="test.src.dir">Must set test.src.dir</fail>
5.17 <fail unless="build.dir">Must set build.dir</fail>
5.18 <fail unless="dist.dir">Must set dist.dir</fail>
5.19 @@ -245,7 +247,7 @@
5.20 </target>
5.21 <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
5.22 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
5.23 - <attribute default="${src.dir}" name="srcdir"/>
5.24 + <attribute default="${src.dir}:${src.sql-dk.dir}" name="srcdir"/>
5.25 <attribute default="${build.classes.dir}" name="destdir"/>
5.26 <attribute default="${javac.classpath}" name="classpath"/>
5.27 <attribute default="${javac.processorpath}" name="processorpath"/>
5.28 @@ -286,7 +288,7 @@
5.29 </target>
5.30 <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
5.31 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
5.32 - <attribute default="${src.dir}" name="srcdir"/>
5.33 + <attribute default="${src.dir}:${src.sql-dk.dir}" name="srcdir"/>
5.34 <attribute default="${build.classes.dir}" name="destdir"/>
5.35 <attribute default="${javac.classpath}" name="classpath"/>
5.36 <attribute default="${javac.processorpath}" name="processorpath"/>
5.37 @@ -319,7 +321,7 @@
5.38 </target>
5.39 <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
5.40 <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
5.41 - <attribute default="${src.dir}" name="srcdir"/>
5.42 + <attribute default="${src.dir}:${src.sql-dk.dir}" name="srcdir"/>
5.43 <attribute default="${build.classes.dir}" name="destdir"/>
5.44 <attribute default="${javac.classpath}" name="classpath"/>
5.45 <sequential>
5.46 @@ -917,12 +919,13 @@
5.47 <include name="*"/>
5.48 </dirset>
5.49 </pathconvert>
5.50 - <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
5.51 + <j2seproject3:depend srcdir="${src.dir}:${src.sql-dk.dir}:${build.generated.subdirs}"/>
5.52 </target>
5.53 <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
5.54 <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
5.55 <copy todir="${build.classes.dir}">
5.56 <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
5.57 + <fileset dir="${src.sql-dk.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
5.58 </copy>
5.59 </target>
5.60 <target if="has.persistence.xml" name="-copy-persistence-xml">
5.61 @@ -943,7 +946,7 @@
5.62 <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
5.63 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
5.64 <j2seproject3:force-recompile/>
5.65 - <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
5.66 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}:${src.sql-dk.dir}"/>
5.67 </target>
5.68 <target name="-post-compile-single">
5.69 <!-- Empty placeholder for easier customization. -->
5.70 @@ -1212,6 +1215,9 @@
5.71 <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
5.72 <filename name="**/*.java"/>
5.73 </fileset>
5.74 + <fileset dir="${src.sql-dk.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
5.75 + <filename name="**/*.java"/>
5.76 + </fileset>
5.77 <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
5.78 <include name="**/*.java"/>
5.79 <exclude name="*.java"/>
5.80 @@ -1222,6 +1228,9 @@
5.81 <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
5.82 <filename name="**/doc-files/**"/>
5.83 </fileset>
5.84 + <fileset dir="${src.sql-dk.dir}" excludes="${excludes}" includes="${includes}">
5.85 + <filename name="**/doc-files/**"/>
5.86 + </fileset>
5.87 <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
5.88 <include name="**/doc-files/**"/>
5.89 </fileset>
6.1 --- a/java/jdbc-dk-driver/nbproject/genfiles.properties Sat May 16 20:13:43 2015 +0200
6.2 +++ b/java/jdbc-dk-driver/nbproject/genfiles.properties Sat May 16 20:25:16 2015 +0200
6.3 @@ -1,8 +1,8 @@
6.4 -build.xml.data.CRC32=a8f4d4a7
6.5 +build.xml.data.CRC32=64e20838
6.6 build.xml.script.CRC32=3b53b17c
6.7 build.xml.stylesheet.CRC32=8064a381@1.75.2.48
6.8 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
6.9 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6.10 -nbproject/build-impl.xml.data.CRC32=a8f4d4a7
6.11 -nbproject/build-impl.xml.script.CRC32=2ad2d140
6.12 +nbproject/build-impl.xml.data.CRC32=64e20838
6.13 +nbproject/build-impl.xml.script.CRC32=01f7bc2f
6.14 nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
7.1 --- a/java/jdbc-dk-driver/nbproject/project.properties Sat May 16 20:13:43 2015 +0200
7.2 +++ b/java/jdbc-dk-driver/nbproject/project.properties Sat May 16 20:25:16 2015 +0200
7.3 @@ -1,9 +1,10 @@
7.4 annotation.processing.enabled=true
7.5 annotation.processing.enabled.in.editor=false
7.6 -annotation.processing.processor.options=
7.7 annotation.processing.processors.list=
7.8 annotation.processing.run.all.processors=true
7.9 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
7.10 +application.title=jdbc-dk-driver
7.11 +application.vendor=fiki
7.12 build.classes.dir=${build.dir}/classes
7.13 build.classes.excludes=**/*.java,**/*.form
7.14 # This directory is removed when the project is cleaned:
7.15 @@ -26,6 +27,7 @@
7.16 dist.dir=dist
7.17 dist.jar=${dist.dir}/jdbc-dk-driver.jar
7.18 dist.javadoc.dir=${dist.dir}/javadoc
7.19 +endorsed.classpath=
7.20 excludes=
7.21 includes=**
7.22 jar.compress=false
7.23 @@ -68,4 +70,5 @@
7.24 ${build.test.classes.dir}
7.25 source.encoding=UTF-8
7.26 src.dir=src
7.27 +src.sql-dk.dir=libs/sql-dk
7.28 test.src.dir=test
8.1 --- a/java/jdbc-dk-driver/nbproject/project.xml Sat May 16 20:13:43 2015 +0200
8.2 +++ b/java/jdbc-dk-driver/nbproject/project.xml Sat May 16 20:25:16 2015 +0200
8.3 @@ -6,6 +6,7 @@
8.4 <name>jdbc-dk-driver</name>
8.5 <source-roots>
8.6 <root id="src.dir"/>
8.7 + <root id="src.sql-dk.dir"/>
8.8 </source-roots>
8.9 <test-roots>
8.10 <root id="test.src.dir"/>
9.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java Sat May 16 20:13:43 2015 +0200
9.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java Sat May 16 20:25:16 2015 +0200
9.3 @@ -19,6 +19,7 @@
9.4
9.5 import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
9.6 import static info.globalcode.sql.dk.Functions.findByName;
9.7 +import info.globalcode.sql.dk.formatting.DsvFormatter;
9.8 import info.globalcode.sql.dk.formatting.SilentFormatter;
9.9 import info.globalcode.sql.dk.formatting.SingleValueFormatter;
9.10 import info.globalcode.sql.dk.formatting.TabularFormatter;
9.11 @@ -70,6 +71,7 @@
9.12 l.add(new FormatterDefinition(TabularPrefetchingFormatter.NAME, TabularPrefetchingFormatter.class.getName()));
9.13 l.add(new FormatterDefinition(TabularWrappingFormatter.NAME, TabularWrappingFormatter.class.getName()));
9.14 l.add(new FormatterDefinition(TeXFormatter.NAME, TeXFormatter.class.getName()));
9.15 + l.add(new FormatterDefinition(DsvFormatter.NAME, DsvFormatter.class.getName()));
9.16 buildInFormatters = Collections.unmodifiableCollection(l);
9.17 }
9.18
10.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/DatabaseDefinition.java Sat May 16 20:13:43 2015 +0200
10.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/DatabaseDefinition.java Sat May 16 20:25:16 2015 +0200
10.3 @@ -87,12 +87,17 @@
10.4 /**
10.5 * @param properties ad-hoc properties from CLI options (for the JDBC driver)
10.6 * @param jmxBean JMX management bean for progress reporting | null = disable JMX
10.7 + * @return
10.8 + * @throws java.sql.SQLException
10.9 */
10.10 public DatabaseConnection connect(Properties properties, ConnectionManagement jmxBean) throws SQLException {
10.11 return new DatabaseConnection(this, properties, jmxBean);
10.12 }
10.13
10.14 /**
10.15 + * @param properties
10.16 + * @return
10.17 + * @throws java.sql.SQLException
10.18 * @see #connect(info.globalcode.sql.dk.configuration.Properties, java.lang.String)
10.19 * With disabled JMX reporting.
10.20 */
11.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/FormatterDefinition.java Sat May 16 20:13:43 2015 +0200
11.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/FormatterDefinition.java Sat May 16 20:25:16 2015 +0200
11.3 @@ -18,7 +18,6 @@
11.4 package info.globalcode.sql.dk.configuration;
11.5
11.6 import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
11.7 -import info.globalcode.sql.dk.DKException;
11.8 import info.globalcode.sql.dk.formatting.Formatter;
11.9 import info.globalcode.sql.dk.formatting.FormatterContext;
11.10 import info.globalcode.sql.dk.formatting.FormatterException;
11.11 @@ -91,7 +90,7 @@
11.12 /**
11.13 * @param context
11.14 * @return
11.15 - * @throws DKException
11.16 + * @throws FormatterException
11.17 */
11.18 public Formatter getInstance(FormatterContext context) throws FormatterException {
11.19 context.getProperties().setDefaults(properties);
12.1 --- a/scripts/sql-dk.sh Sat May 16 20:13:43 2015 +0200
12.2 +++ b/scripts/sql-dk.sh Sat May 16 20:25:16 2015 +0200
12.3 @@ -5,8 +5,8 @@
12.4 . ~/.sql-dk/environment.sh
12.5 else
12.6 mkdir -p ~/.sql-dk/
12.7 - touch ~/.sql-dk/environment.sh
12.8 # link/copy support files for configuration:
12.9 + [ -f ~/.sql-dk/environment.sh ] || touch ~/.sql-dk/environment.sh
12.10 [ -f ~/.sql-dk/config.xsd ] || ln -s /usr/share/doc/sql-dk/config.xsd ~/.sql-dk/config.xsd
12.11 [ -f ~/.sql-dk/config.rnc ] || ln -s /usr/share/doc/sql-dk/config.rnc ~/.sql-dk/config.rnc
12.12 [ -f ~/.sql-dk/config.xsl ] || gunzip < /usr/share/doc/sql-dk/config.xsl.gz > ~/.sql-dk/config.xsl # might not work in www browser if just symlinked