Skip to content
Browse files

Fix for queries that return no value to not raise exception in execAn…

…dQuery ... plus upping JDBC drivers for SQLite and PostgreSQL
  • Loading branch information...
1 parent 0cf893b commit 8dcbef7c3dc1a29dd8555adc40dc5b692b335c2c @fjenett committed Dec 16, 2012
View
4 build.xml
@@ -32,8 +32,8 @@
<path id="library-classes-add">
<fileset dir="lib">
<include name="mysql-connector-java-3.1.14-bin.jar"/> <!-- MySQL -->
- <include name="sqlitejdbc-v053-pure.jar"/> <!-- SQLite -->
- <include name="postgresql-8.3-604.jdbc3.jar"/> <!-- PostgreSQL -->
+ <include name="sqlite-jdbc-3.7.2.jar"/> <!-- SQLite -->
+ <include name="postgresql-9.2-1002.jdbc3.jar"/> <!-- PostgreSQL -->
</fileset>
</path>
View
4 lib/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Sun Dec 16 14:55:12 CET 2012
-build.number=537
+#Sun Dec 16 20:08:51 CET 2012
+build.number=543
View
2 release/BezierSQLib.txt
@@ -4,5 +4,5 @@ url = https://github.com/fjenett/sql-library-processing
category = DATA
sentence = A library to facilitate communication with SQL-based databases
paragraph = SQLibrary is an interface to MySQL, SQLite and PostgreSQL databases
-version = 1103
+version = 1116
prettyVersion = 0.2.0
View
BIN release/BezierSQLib.zip
Binary file not shown.
View
4 resources/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Sun Dec 16 14:55:16 CET 2012
-build.number=1111
+#Sun Dec 16 20:08:51 CET 2012
+build.number=1117
View
6 resources/web/index.html
@@ -153,12 +153,12 @@
</div>
<div id="footer">
- by ##author##, 2008–today. &nbsp;|&nbsp;
- included jdbc drives are available from <a href="http://www.mysql.com/products/connector/j/">MySQL AB</a>, <a href="http://www.zentus.com/sqlitejdbc/">David Crawshaw</a> and <a>PostgreSQL</a>.
+ By ##author##, 2008–today. &nbsp;|&nbsp;
+ included JDBC drives are available from <a href="http://www.mysql.com/products/connector/j/">MySQL AB</a>, <a href="http://code.google.com/p/sqlite-jdbc/">sqlite-jdbc</a> and <a href="http://jdbc.postgresql.org/">PostgreSQL</a>.
</div>
</div>
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
-
+
</body>
</html>
View
19 src/de/bezier/data/sql/SQL.java
@@ -285,9 +285,7 @@ public void query ( String _sql, Object ... args )
ex.printStackTrace();
return;
}
- // Object[] args2 = new Object[args.length+1];
- // args2[0] = _sql;
- // System.arraycopy( args, 0, args2, 1, args.length );
+
String sql2 = null;
try {
sql2 = (String)meth.invoke( null, _sql, args );
@@ -318,15 +316,20 @@ private void queryOrExecute ( String _sql, boolean keep )
statement = connection.createStatement();
}
- java.sql.ResultSet result = statement.executeQuery( _sql );
-
- if ( keep )
- this.result = result;
+ boolean hasResults = statement.execute( _sql );
+
+ if ( keep && hasResults )
+ {
+ this.result = statement.getResultSet();
+ }
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.query(): java.sql.SQLException.\r" );
- if (DEBUG) e.printStackTrace();
+ if (DEBUG) {
+ System.out.println( _sql );
+ e.printStackTrace();
+ }
}
}

0 comments on commit 8dcbef7

Please sign in to comment.
Something went wrong with that request. Please try again.