Permalink
Browse files

raise on AR load failure + do not rescue our requires + prepare for 1…

….2.6
  • Loading branch information...
1 parent f7f87fb commit 0c0fc102424b2fb0490f14e95401cb35f0b3601d @kares kares committed Jan 31, 2013
Showing with 91 additions and 31 deletions.
  1. +49 −2 History.txt
  2. +37 −22 README.md
  3. +3 −5 lib/arjdbc.rb
  4. BIN lib/arjdbc/jdbc/adapter_java.jar
  5. +1 −1 lib/arjdbc/version.rb
  6. +1 −1 rakelib/02-test.rake
View
@@ -1,3 +1,50 @@
+== 1.2.6 (01/31/13)
+
+- [postgres] only set --schema (to seach path) for pg_dump if configured (#315)
+- [oracle] id limits + quoting; current user/db/schema + savepoint support
+- execute "log" (sql) name correctly based on AR version
+- deprecate substitute_binds and extract_sql
+- [derby] make sure we never modify the passed sql param
+- [sqlite3] execute on insert_sql + savepoint support
+- [mssql] [firebird] [informix] (shared) serialized attribute support
+- [oracle] (shared) serialized attribute support
+- [sqlite3] fix binary column handling failure (#51)
+- renamed Sqlite3RubyJdbcConnection to SQLite3RubyJdbcConnection
+- [mysql] re-define remove_index! for "better" AR-2.3 compatibility
+- [derby] avoid failures with #quote when second arg nil + keep string encoding
+- [db2] binary support & improved quoting +
+ use lob callback for all since it was failing on BLOB/CLOB inserts otherwise
+- [db2] better (simplified) type handling for DB2
+- JRuby 1.6.8 compatibility when rescue-ing Java exception
+- [mysql] avoid encoding issues with MySQL's quoting methods (#185)
+- [postgres] ignore binary precision / limit for bytea
+- [oracle] explain (query) support
+- [oracle] since Oracle supports TIMESTAMP for quite a while we should not
+ create DATE columns for a :timestamp column type
+- [oracle] avoid CREATE DDL failure when BLOB has length specified
+- [jdbc-] review autoloading backwards-incompatible change in jdbc- gems
+ auto-load (backwards-compat) can be enabled back using jdbc.driver.autoload
+ system property or using the driver specific autoload option as well
+- [jdbc-] Update version handling introduce DRIVER_VERSION constant
+- [oracle] should support WITH statements (as SELECTs)
+- expose select? and insert? helpers on JdbcAdapter class
+- [postgres] bug in create_database without options (#306)
+- [db2] correct DB2 schema selection (when as400 url has parameters)
+- [db2] DB2 becomes a first-class citizen (adapter) `adapter: db2`
+- [h2] [hsqldb] explain support for H2 and HSQLDB
+- [db2] column should be checked if ain't nil when quoting on DB2
+- [mssql] raise exception when offset is specified but limit is not
+- [sqlite3] SQLite3 explain support (Rails style)
+- [postgres] (re-usable) explain support for PostgreSQL (based on Rails)
+- [h2] update handling of time fields on H2/HSQLDB (#252)
+- rescue (and wrap) only SQLExceptions from driver.connect this caused
+ swallowing of runtime exceptions from JDBC drivers
+- support for setting (custom) jdbc driver properties in config
+- when a new adapter (constant) gets loaded column types should pick it up
+- [jdbc-derby] updated to 10.8.3.0
+- raise LoadError with explanation on with jTDS 1.3.0 on non Java 1.7
+- setup the connection methods when adapter is loaded (broken in 1.2.5)
+
== 1.2.5 (01/02/13)
- backwards compat with older jdbc- (driver) gems (#279)
@@ -287,7 +334,7 @@
- ACTIVERECORD_JDBC-97: Dont use Rails 3 deprecated constants (David
Calavera)
- Updates for rake db:schema:dump compatibility with Rails 2.3+ and
- MySQL (Joakim Kolsj�)
+ MySQL (Joakim Kolsj�)
- Rails 3.0.0.beta2 compatibility
- Return of Derby, H2, Hsqldb support (requires AR >= 3.0.0.beta2)
@@ -378,7 +425,7 @@
actual maximum size of the JNDI connection pool. (We'll look at how
to eliminate the need to configure AR's pool in the future.)
- NEW! Informix support courtesy of Javier Fernandez-Ivern.
-- Backport another Oracle CLOB issue, thanks Edson C�sar.
+- Backport another Oracle CLOB issue, thanks Edson C�sar.
- Rubyforge #22018: chomp final trailing semicolon for oracle
- JRUBY-2848: Fix NPE error in set_native_database_types
- Rework oracle lob saving callback to be Rails 2.1 friendly (assist
View
@@ -1,17 +1,22 @@
# ActiveRecord JDBC Adapter
-Activerecord-jdbc-adapter is a database adapter for Rails' *ActiveRecord*
-component that can be used with [JRuby][0]. It allows use of virtually any
-JDBC-compliant database with your JRuby on Rails application.
+ActiveRecord-JDBC-Adapter (AR-JDBC) is a database adapter for Rails'
+*ActiveRecord* component that can be used with [JRuby][0]. It allows use of
+virtually any JDBC-compliant database with your JRuby on Rails application.
+
+AR-JDBC **1.2.x** officially supports ActiveRecord 3.x as well as 2.3, it's
+latest version is compatible with JRuby 1.6.8+ (but as always we recommend to
+use the latest and greatest of JRubies) thus requires Java 1.6 at minimum.
## Databases
-Activerecord-jdbc-adapter provides full or nearly full support for:
+ActiveRecord-JDBC-Adapter provides full or nearly full support for:
**MySQL**, **PostgreSQL**, **SQLite3**, **Oracle**, **Microsoft SQL Server**,
**DB2**, **FireBird**, **Derby**, **HSQLDB**, **H2**, and **Informix**.
Other databases will require testing and likely a custom configuration module.
-Please join the JRuby [mailing list][1] to help us discover support for more databases.
+Please join the JRuby [mailing list][1] to help us discover support for more
+databases.
## Using ActiveRecord JDBC
@@ -95,6 +100,20 @@ production:
jndi: jdbc/mysqldb
```
+JDBC driver specific properties might be set if you use an URL to specify the DB
+or using the *properties:* syntax (since AR-JDBC **1.2.6**) :
+
+```yml
+production:
+ adapter: mysql
+ username: blog
+ password: blog
+ url: "jdbc:mysql://localhost:3306/weblog?profileSQL=true"
+ properties: # specific to com.mysql.jdbc.Driver
+ socketTimeout: 60000
+ connectTimeout: 60000
+```
+
If you're really old school you might want to use AR-JDBC with a DB2 on z/OS :
```yml
@@ -127,7 +146,7 @@ directly and the driver gem (dependency) will be installed as well :
```ruby
ActiveRecord::Base.establish_connection(
- :adapter => 'jdbcderby',
+ :adapter => 'derby', # or 'jdbcderby'
:database => "db/my-database"
)
```
@@ -138,7 +157,7 @@ or like (but requires that you manually put the driver jar on the classpath) :
ActiveRecord::Base.establish_connection(
:adapter => 'jdbc',
:driver => 'org.apache.derby.jdbc.EmbeddedDriver',
- :url => 'jdbc:derby:test_ar;create=true'
+ :url => 'jdbc:derby:sample_db;create=true'
)
```
@@ -158,12 +177,6 @@ gem 'activerecord-jdbcmysql-adapter', :github => 'jruby/activerecord-jdbc-adapte
gem 'jdbc-mysql', :github => 'jruby/activerecord-jdbc-adapter'
```
-## Feedback
-
-Please report bugs at our [issue tracker][3]. If you're not sure if
-something's a bug, feel free to pre-report it on the [mailing lists][1] or
-ask on the #JRuby IRC channel on http://freenode.net/.
-
## Running AR-JDBC Tests
[![Build Status][9]](http://travis-ci.org/#!/jruby/activerecord-jdbc-adapter)
@@ -180,9 +193,6 @@ If you also have PostgreSQL available, those tests will be run if the
You can control the host and port the tests will attempt to by setting
the environment variables `PGHOST` and `PGPORT`.
-If you want Rails logging enabled during these test runs you can edit
-*test/jdbc_common.rb* and add the line `require 'db/logger'`.
-
To execute a single test case, you can run:
rake appraisal:{version} test_{db} TEST=test/{tests_file}
@@ -193,14 +203,14 @@ Substitute the *version* of ActiveRecord for version, which can be one of :
The db can be one of these : *sqlite3*, *mysql*, *postgres*,
*mssql*, *sybase*, *oracle*, *db2*, *derby*, *h2* or *hssql*.
-Finally, the *tests_file* will be whichever test case you want to run.
+Finally, the *tests_file* will be whichever (.rb) test case you want to run.
### Running AR Tests
To run the current AR-JDBC sources with `ActiveRecord`, just use the included
`rails:test` task. Be sure to specify a driver and a path to the AR's sources :
- jruby -S rake rails:test DRIVER=mysql RAILS=/path/activerecord_source_dir
+ jruby -S rake rails:test DRIVER=mysql RAILS=/path/rails_source_dir
## Extending AR-JDBC
@@ -209,19 +219,24 @@ that core AR-JDBC does not support. We've created an example project
for the Intersystems Cache database that you can examine as a template.
See the [cachedb-adapter project][4] for more information.
+## Feedback
+
+Please report bugs at our [issue tracker][3]. If you're not sure if
+something's a bug, feel free to pre-report it on the [mailing lists][1] or
+ask on the #JRuby IRC channel on http://freenode.net/.
+
## Authors
This project was written by Nick Sieger <nick@nicksieger.com> and Ola Bini
<olabini@gmail.com> with lots of help from the JRuby community.
## License
-activerecord-jdbc-adapter is released under a BSD license.
+ActiveRecord-JDBC-Adapter is released under the BSD/MIT license.
See the LICENSE.txt file included with the distribution for details.
-Open-source driver gems for activerecord-jdbc-adapter are licensed under the
-same license the database's drivers are licensed. See each driver gem's
-LICENSE.txt file for details.
+Open-source driver gems within AR-JDBC's sources are licensed under the same
+license the database's drivers are licensed. See each driver gem's LICENSE.txt.
[0]: http://www.jruby.org/
[1]: http://jruby.org/community
View
@@ -7,16 +7,14 @@
else
RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end
- if ActiveRecord::VERSION::MAJOR == 1 && ActiveRecord::VERSION::MINOR == 14
- require 'arjdbc/jdbc'
- end
else
require 'active_record'
- require 'arjdbc/jdbc'
end
- rescue LoadError
+ rescue LoadError => e
warn "activerecord-jdbc-adapter requires ActiveRecord at runtime"
+ raise e
end
+ require 'arjdbc/jdbc'
else
warn "activerecord-jdbc-adapter is for use with JRuby only"
end
Binary file not shown.
View
@@ -1,6 +1,6 @@
module ArJdbc
module Version
- VERSION = "1.2.5"
+ VERSION = "1.2.6"
end
end
# Compatibility with older versions of ar-jdbc for other extensions out there
View
@@ -47,7 +47,7 @@ def declare_test_task_for(adapter, options = {})
t.libs.push *FileList["activerecord-jdbc#{adapter}*/lib"]
end
t.libs << "test"
- t.verbose = true
+ t.verbose = true if $VERBOSE
end
Rake::TestTask.new("test_#{adapter}" => prereqs) { |t| test_task.call t }
Rake::TestTask.new("test_jdbc_#{adapter}" => prereqs) { |t| test_task.call t }

0 comments on commit 0c0fc10

Please sign in to comment.