activerecord-jdbc-adapter 0.9.3-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. data/History.txt +248 -0
  2. data/LICENSE.txt +21 -0
  3. data/Manifest.txt +125 -0
  4. data/README.txt +218 -0
  5. data/Rakefile +10 -0
  6. data/lib/active_record/connection_adapters/cachedb_adapter.rb +1 -0
  7. data/lib/active_record/connection_adapters/derby_adapter.rb +13 -0
  8. data/lib/active_record/connection_adapters/h2_adapter.rb +13 -0
  9. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +13 -0
  10. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -0
  11. data/lib/active_record/connection_adapters/jdbc_adapter.rb +640 -0
  12. data/lib/active_record/connection_adapters/jdbc_adapter_spec.rb +26 -0
  13. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -0
  14. data/lib/active_record/connection_adapters/mysql_adapter.rb +13 -0
  15. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
  16. data/lib/active_record/connection_adapters/postgresql_adapter.rb +13 -0
  17. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +13 -0
  18. data/lib/generators/jdbc/jdbc_generator.rb +9 -0
  19. data/lib/jdbc_adapter.rb +27 -0
  20. data/lib/jdbc_adapter/jdbc.rake +121 -0
  21. data/lib/jdbc_adapter/jdbc_adapter_internal.jar +0 -0
  22. data/lib/jdbc_adapter/jdbc_cachedb.rb +33 -0
  23. data/lib/jdbc_adapter/jdbc_db2.rb +203 -0
  24. data/lib/jdbc_adapter/jdbc_derby.rb +430 -0
  25. data/lib/jdbc_adapter/jdbc_firebird.rb +109 -0
  26. data/lib/jdbc_adapter/jdbc_hsqldb.rb +218 -0
  27. data/lib/jdbc_adapter/jdbc_informix.rb +147 -0
  28. data/lib/jdbc_adapter/jdbc_mimer.rb +141 -0
  29. data/lib/jdbc_adapter/jdbc_mssql.rb +337 -0
  30. data/lib/jdbc_adapter/jdbc_mysql.rb +236 -0
  31. data/lib/jdbc_adapter/jdbc_oracle.rb +377 -0
  32. data/lib/jdbc_adapter/jdbc_postgre.rb +498 -0
  33. data/lib/jdbc_adapter/jdbc_sqlite3.rb +384 -0
  34. data/lib/jdbc_adapter/jdbc_sybase.rb +50 -0
  35. data/lib/jdbc_adapter/missing_functionality_helper.rb +87 -0
  36. data/lib/jdbc_adapter/rake_tasks.rb +10 -0
  37. data/lib/jdbc_adapter/tsql_helper.rb +60 -0
  38. data/lib/jdbc_adapter/version.rb +5 -0
  39. data/lib/pg.rb +4 -0
  40. data/rails_generators/jdbc_generator.rb +15 -0
  41. data/rails_generators/templates/config/initializers/jdbc.rb +7 -0
  42. data/rails_generators/templates/lib/tasks/jdbc.rake +8 -0
  43. data/rakelib/compile.rake +23 -0
  44. data/rakelib/package.rake +90 -0
  45. data/rakelib/rails.rake +41 -0
  46. data/rakelib/test.rake +76 -0
  47. data/src/java/jdbc_adapter/JdbcAdapterInternalService.java +53 -0
  48. data/src/java/jdbc_adapter/JdbcConnectionFactory.java +36 -0
  49. data/src/java/jdbc_adapter/JdbcDerbySpec.java +293 -0
  50. data/src/java/jdbc_adapter/JdbcMySQLSpec.java +134 -0
  51. data/src/java/jdbc_adapter/MssqlRubyJdbcConnection.java +71 -0
  52. data/src/java/jdbc_adapter/PostgresRubyJdbcConnection.java +55 -0
  53. data/src/java/jdbc_adapter/RubyJdbcConnection.java +1162 -0
  54. data/src/java/jdbc_adapter/SQLBlock.java +27 -0
  55. data/src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java +41 -0
  56. data/test/abstract_db_create.rb +107 -0
  57. data/test/activerecord/connection_adapters/type_conversion_test.rb +31 -0
  58. data/test/activerecord/connections/native_jdbc_mysql/connection.rb +25 -0
  59. data/test/cachedb_simple_test.rb +6 -0
  60. data/test/db/cachedb.rb +9 -0
  61. data/test/db/db2.rb +9 -0
  62. data/test/db/derby.rb +14 -0
  63. data/test/db/h2.rb +11 -0
  64. data/test/db/hsqldb.rb +12 -0
  65. data/test/db/informix.rb +11 -0
  66. data/test/db/jdbc.rb +11 -0
  67. data/test/db/jndi_config.rb +30 -0
  68. data/test/db/logger.rb +3 -0
  69. data/test/db/mssql.rb +9 -0
  70. data/test/db/mysql.rb +10 -0
  71. data/test/db/oracle.rb +34 -0
  72. data/test/db/postgres.rb +9 -0
  73. data/test/db/sqlite3.rb +15 -0
  74. data/test/db2_simple_test.rb +10 -0
  75. data/test/derby_migration_test.rb +21 -0
  76. data/test/derby_multibyte_test.rb +12 -0
  77. data/test/derby_simple_test.rb +21 -0
  78. data/test/generic_jdbc_connection_test.rb +9 -0
  79. data/test/h2_simple_test.rb +6 -0
  80. data/test/has_many_through.rb +79 -0
  81. data/test/helper.rb +5 -0
  82. data/test/hsqldb_simple_test.rb +6 -0
  83. data/test/informix_simple_test.rb +48 -0
  84. data/test/jdbc_adapter/jdbc_db2_test.rb +26 -0
  85. data/test/jdbc_adapter/jdbc_sybase_test.rb +33 -0
  86. data/test/jdbc_common.rb +25 -0
  87. data/test/jndi_callbacks_test.rb +38 -0
  88. data/test/jndi_test.rb +35 -0
  89. data/test/manualTestDatabase.rb +191 -0
  90. data/test/minirunit.rb +109 -0
  91. data/test/minirunit/testConnect.rb +14 -0
  92. data/test/minirunit/testH2.rb +73 -0
  93. data/test/minirunit/testHsqldb.rb +73 -0
  94. data/test/minirunit/testLoadActiveRecord.rb +3 -0
  95. data/test/minirunit/testMysql.rb +83 -0
  96. data/test/minirunit/testRawSelect.rb +24 -0
  97. data/test/models/add_not_null_column_to_table.rb +12 -0
  98. data/test/models/auto_id.rb +18 -0
  99. data/test/models/data_types.rb +28 -0
  100. data/test/models/entry.rb +23 -0
  101. data/test/models/mixed_case.rb +20 -0
  102. data/test/models/reserved_word.rb +18 -0
  103. data/test/models/string_id.rb +18 -0
  104. data/test/models/validates_uniqueness_of_string.rb +19 -0
  105. data/test/mssql_simple_test.rb +6 -0
  106. data/test/mysql_db_create_test.rb +25 -0
  107. data/test/mysql_multibyte_test.rb +10 -0
  108. data/test/mysql_nonstandard_primary_key_test.rb +42 -0
  109. data/test/mysql_simple_test.rb +32 -0
  110. data/test/oracle_simple_test.rb +29 -0
  111. data/test/pick_rails_version.rb +3 -0
  112. data/test/postgres_db_create_test.rb +21 -0
  113. data/test/postgres_mixed_case_test.rb +19 -0
  114. data/test/postgres_nonseq_pkey_test.rb +40 -0
  115. data/test/postgres_reserved_test.rb +22 -0
  116. data/test/postgres_schema_search_path_test.rb +46 -0
  117. data/test/postgres_simple_test.rb +13 -0
  118. data/test/simple.rb +475 -0
  119. data/test/sqlite3_simple_test.rb +233 -0
  120. data/test/sybase_jtds_simple_test.rb +6 -0
  121. metadata +188 -0
@@ -0,0 +1,248 @@
1
+ == 0.9.3
2
+
3
+ - Rails 3 compatibility
4
+ - PLEASE NOTE: ActiveRecord in Rails 3 has changed in a way that
5
+ doesn't allow non-standard DBs (such as the Derby and H2 embedded
6
+ DBs) to work. We're investigating the effort required to support
7
+ these databases and hope to have something for a future release.
8
+ - ACTIVERECORD_JDBC-91: Fix schema search path for PostgreSQL (Alex
9
+ Kuebo)
10
+ - ACTIVERECORD_JDBC-87: DB2 ID insert fix (Youhei Kondou)
11
+ - ACTIVERECORD_JDBC-90: MSSQL fix for DATEs (jlangenauer)
12
+ - ACTIVERECORD_JDBC-93: Fix string IDs for sqlite3, hsql/h2 (moser)
13
+ - ACTIVERECORD_JDBC-86: Fix Derby queries starting with VALUES (Dwayne Litzenberger)
14
+ - ACTIVERECORD_JDBC-95: Fix INSERT ... RETURNING for PostgreSQL
15
+
16
+ == 0.9.2
17
+
18
+ - The main, highly awaited fix for this release is a solution to the
19
+ rake db:create/db:drop issue. The main change is a new 'jdbc' rails
20
+ generator that should be run once to prepare a Rails application to
21
+ use JDBC. The upside of this generator is that you no longer will
22
+ need to alter database.yml for JDBC. See the README.txt for details.
23
+ - Cleanup and reconnect if errors occur during begin/rollback
24
+ (Jean-Dominique Morani, Christian Seiler)
25
+ - ACTIVERECORD_JDBC-1: Add #drop_database method for oracle (does the
26
+ same thing as recreate_database)
27
+ - Sqlite3 and MSSQL fixes (Jean-Dominique Morani)
28
+ - JRUBY-3512: Treat LONGVARCHAR as a CLOB for Mssql
29
+ - JRUBY-3624: Upgrade Derby to 10.5.3.0 and add native limit/offset
30
+ support (Christopher Saunders)
31
+ - JRUBY-3616: Fix postgres non-sequence primary keys (David Kellum)
32
+ - JRUBY-3669: Fix Oracle case with unconfigured schema (Dan Powell)
33
+ - Fixed quote_column_name of jdbc_oracle to accept numbers (Marcelo
34
+ Murad)
35
+ - Fix for mysql tables with non standard primary keys such that the
36
+ schema dump is correct (Nick Zalabak)
37
+ - MSSQL fixes from Mike Luu:
38
+ - add support for MSSQL uniqueidentifier datatype
39
+ - always quote strings using unicode identifier for MSSQL
40
+ - Changes primary_key generation to use always instead of by default
41
+ for DB2 (Amos King)
42
+ - Improves the SQLite adapter by fixing rename_column, change_column,
43
+ change_column_default, changing remove_column, and adding
44
+ remove_columns (Ryan Baumann)
45
+ - More oracle love courtesy Ben Browning and Jens Himmelreich
46
+ - JRUBY-3608: Add missing change_column_null method for postgres
47
+ - JRUBY-3508: Fix quoting of integer and float columns
48
+
49
+ == 0.9.1
50
+
51
+ - We did a lot of internal cleanup this release in the hopes of
52
+ simplifying the code and increasing performance.
53
+ - Many SQLite updates (thanks Nils Christian Haugen)
54
+ - JRUBY-2912: Fix MSSQL create/drop database (Joern Hartmann)
55
+ - JRUBY-2767: Mistake in selecting identity with H2/HSQLDB
56
+ - JRUBY-2884: jdbc_postgre.rb issue handling nil booleans (also a fix
57
+ for hsqldb/h2) + tests
58
+ - JRUBY-2995: activerecord jdbc derby adapter should quote columns
59
+ called 'year'
60
+ - JRUBY-2897: jdbc_postgre.rb needs microsecond support
61
+ - JRUBY-3282: Upgrade to derby 10.4.2.0 to allow unique constraints
62
+ with nullable columns
63
+ - Update h2 from 1.0.63 to 1.1.107 in driver
64
+ - JRUBY-3026: [Derby] Allow select/delete/update conditions with
65
+ comparison to NULL using '='
66
+ - JRUBY-2996: ...(actually this fixes only remaining issue of this bug
67
+ which was symbols making into quote were exploding
68
+ - JRUBY-2691: Update sybase driver to pass simple unit tests with jtds
69
+ and verify it works with the new dialect keyword. patch by Leigh
70
+ Kennedy
71
+ - Make :float type work on h2,hsql [returned as string]. Make :float
72
+ work on hsqldb (no paren value supported). Make REAL_TYPE just
73
+ return RubyFloat
74
+ - JRUBY-3222: Upgrade #type_to_sql to variation of AR 2.1.2 version
75
+ - Add patch supplied in JRUBY-3489 (patch by Jean-Dominique Morani)
76
+ - Various Oracle fixes by edsono
77
+ - JRUBY-2688: Don't hard-code MySQL connection character encoding to
78
+ utf8
79
+
80
+ == 0.9
81
+
82
+ - Now updated to support ActiveRecord 2.2. JNDI-based connections will
83
+ automatically connect/disconnect for every AR connection pool
84
+ checkout/checkin. For best results, set your pool: parameter >= the
85
+ actual maximum size of the JNDI connection pool. (We'll look at how
86
+ to eliminate the need to configure AR's pool in the future.)
87
+ - NEW! Informix support courtesy of Javier Fernandez-Ivern.
88
+ - Backport another Oracle CLOB issue, thanks Edson C�sar.
89
+ - Rubyforge #22018: chomp final trailing semicolon for oracle
90
+ - JRUBY-2848: Fix NPE error in set_native_database_types
91
+ - Rework oracle lob saving callback to be Rails 2.1 friendly (assist
92
+ from court3nay)
93
+ - JRUBY-2715: Add create/drop database methods to Postgres (Peter Williams)
94
+ - JRUBY-3183: Fix structure dump for Postgres (Ryan Bell)
95
+ - JRUBY-3184: recreate_database for test database working for PG (Ryan Bell)
96
+ - JRUBY-3186: disable referential integrity for PG (Ryan Bell)
97
+ - Authoritative repository now hosted at
98
+ git://github.com/nicksieger/activerecord-jdbc-adapter.git; rubyforge
99
+ svn trunk cleaned out.
100
+
101
+ == 0.8.2
102
+
103
+ - Added an optional config key called :dialect. Using :dialect allows you to
104
+ override the default SQL dialect for the driver class being used. There are
105
+ a few cases for this:
106
+ - Using using Sybase w/ the jTDS driver.
107
+ - Using rebranded drivers.
108
+ - It makes more sense to use :dialect, rather then :driver when using JNDI.
109
+ - JRUBY-2619: Typo with :test config causing problems with dev database (Igor Minar)
110
+ - 20524, JRUBY-2612: Since when did I think that there was a #true? method on Object?
111
+
112
+ == 0.8.1
113
+
114
+ - Now sporting a JDBC sqlite3 adapter! Thanks Joseph Athman.
115
+ - Added support for InterSystems Cache database (Ryan Bell)
116
+ - Fix for JRUBY-2256
117
+ - JRUBY-1638, JRUBY-2404, JRUBY-2463: schema.table handling and Oracle NUMBER fixes (Darcy Schultz & Jesse Hu)
118
+ - Add structure dump and other DDL-ish for DB2 (courtesy abedra and stuarthalloway)
119
+ - Fix missing quote_table_name function under Rails 1.2.6 and earlier
120
+ - Small tweaks to jdbc.rake to select proper config
121
+ - JRUBY-2011: Fix MSSQL string un-quoting issue (Silvio Fonseca)
122
+ - JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
123
+ - 20479: Improve get_table_name for MSSQL (Aslak Hellesøy)
124
+ - 20243: numerics improvements for MSSQL (Aslak Hellesøy)
125
+ - 20172: don't quote table names for MSSQL (Thor Marius Henrichsen)
126
+ - 19729: check for primary key existence in postgres during insert (Martin Luder)
127
+ - JRUBY-2297, 18846: retrying failing SQL statements is harmful when not autocommitting (Craig McMillan)
128
+ - 10021: very preliminary sybase support. (Mark Atkinson) Not usable until collision w/ sqlserver driver is resolved.
129
+ - JRUBY-2312, JRUBY-2319, JRUBY-2322: Oracle timestamping issues (Jesse Hu & Michael König)
130
+ - JRUBY-2422: Fix MySQL referential integrity and rollback issues
131
+ - JRUBY-2382: mysql string quoting fails with ArrayIndexOutofBoundsException
132
+
133
+ == 0.8
134
+
135
+ - NOTE: This release is only compatible with JRuby 1.1RC3 or later.
136
+ - Because of recent API changes in trunk in preparation for JRuby 1.1, this release is not
137
+ backward compatible with previous JRuby releases. Hence the version bump.
138
+ - Internal: convert Java methods to be defined with annotations
139
+ - Fix problem with reserved words coming back pre-quoted from #indexes in postgres
140
+ - JRUBY-2205: Fix N^2 allocation of bytelists for mysql quoting (taw)
141
+ - Attempt a fix for Rubyforge 18059
142
+ - Upgrade derby to 10.3.2.1
143
+ - Fix db:create etc. in the case where JDBC is loaded in Rails' preinitializer.rb
144
+ - Fix db:drop to actually work
145
+ - Fix for Rubyforge #11567 (Matt Williams)
146
+
147
+ == 0.7.2
148
+
149
+ - JRUBY-1905: add_column for derby, hsqldb, and postgresql (Stephen Bannasch)
150
+ - Fix db:create for JDBC
151
+ - Support Rails 2 with the old "require 'jdbc_adapter'" approach
152
+ - JRUBY-1966: Instead of searching for just tables, search for views and tables.
153
+ - JRUBY-1583: DB2 numeric quoting (Ryan Shillington)
154
+ - JRUBY-1634: Oracle DATE type mapping (Daniel Wintschel)
155
+ - JRUBY-1543: rename_column issue with more recent MySQL drivers (Oliver Schmelzle)
156
+ - Rubyforge #15074: ConnectionAdapters::JdbcAdapter.indexes is missing name and
157
+ schema_name parameters in the method signature (Igor Minar)
158
+ - Rubyforge #13558: definition for the indexes method (T Meyarivan)
159
+ - JRUBY-2051: handle schemaname and tablename more correctly for columns
160
+ - JRUBY-2102: Postgres Adapter cannot handle datetime type (Rainer Hahnekamp)
161
+ - JRUBY-2018: Oracle behind ActiveRecord-JDBC fails with "Invalid column index" (K Venkatasubramaniyan)
162
+ - JRUBY-2012: jdbc_mysql structure dump fails for mysql views (Tyler Jennings)
163
+
164
+ == 0.7.1
165
+
166
+ - Add adapter and driver for H2 courtesy of Caleb Land
167
+ - Fix "undefined method `last' for {}:Hash" error introduced with new Rake 0.8.1 (JRUBY-1859)
168
+
169
+ == 0.7
170
+
171
+ - PLEASE NOTE: This release is not compatible with JRuby releases earlier than
172
+ 1.0.3 or 1.1b2. If you must use JRuby 1.0.2 or earlier, please install the
173
+ 0.6 release.
174
+ - Release coincides with JRuby 1.0.3 and JRuby 1.1b2 releases
175
+ - Simultaneous support for JRuby trunk and 1.0 branch
176
+ - Get rid of log_no_bench method, so we time SQL execution again.
177
+ - Implement #select_rows
178
+ - MySQL migration and quoting updates
179
+
180
+ == 0.6
181
+
182
+ - Gem is renamed to "activerecord-jdbc-adapter" to follow new conventions
183
+ introduced in Rails 2.0 for third-party adapters. Rails 2.0 compatibility is
184
+ introduced.
185
+ - Add dependency on ActiveRecord >= 1.14 (from the Rails 1.1.x release)
186
+ - New drivers (jdbc-XXX) and adapter (activerecord-jdbcXXX-adapter) gems
187
+ available separately. See the README.txt file for details.
188
+ - Plain "jdbc" driver is still available if you want to use the full
189
+ driver/url way of specifying the driver.
190
+ - More bugfixes to Oracle and SQLServer courtesy of Ola & ThoughtWorks
191
+
192
+ == 0.5
193
+
194
+ - Release coincides with JRuby 1.0.1 release
195
+ - It is no longer necessary to specify :driver and :url configuration
196
+ parameters for the mysql, postgresql, oracle, derby, hsqldb, and h2
197
+ adapters. The previous configuration is still valid and compatible, but for
198
+ new applications, this makes it possible to use the exact same database.yml
199
+ configuration as Rails applications running under native Ruby.
200
+ - JDBC drivers can now be dynamically loaded by Ruby code, without being on
201
+ the classpath prior to launching JRuby. Simply use "require
202
+ 'jdbc-driver.jar'" in JRuby code to add it to the runtime classpath.
203
+ - Updates to HSQL, MS SQLServer, Postgres, Oracle and Derby adapters
204
+
205
+ == 0.4
206
+
207
+ - Release coincides with JRuby 1.0 release
208
+ - Shoring up PostgreSQL (courtesy Dudley Flanders) and HSQL (courtesy Matthew
209
+ Williams)
210
+ - Fix timestamps on Oracle to use DATE (as everything else)
211
+ - Derby fixes: Fix for open result set issue, better structure dump, quoting,
212
+ column type changing
213
+ - Sybase type recognition fix (courtesy Dean Mao)
214
+
215
+ == 0.3.1
216
+
217
+ - Derby critical fixes shortly after 0.3
218
+
219
+ == 0.3
220
+
221
+ - Release coincides with JRuby 1.0.0RC1 release
222
+ - Improvements for Derby, Postgres, and Oracle, all of which are running
223
+ > 95% of AR tests
224
+
225
+ == 0.2.4
226
+
227
+ - Release coincides with JRuby 0.9.9 release
228
+ - JRuby 0.9.9 is required
229
+ - MySQL close to 100% working
230
+ - Derby improvements
231
+ - DECIMAL/NUMERIC/FLOAT/REAL bugs fixed with type recognition for Oracle,
232
+ Postgres, etc.
233
+ - HSQLDB has regressed this release and may not be functioning; we'll get it
234
+ fixed for the next one
235
+
236
+ == 0.2.3
237
+
238
+ - Release coincides (and compatible) with JRuby 0.9.8 release
239
+ - 8 bugs fixed: see http://rubyurl.com/0Da
240
+ - Improvements and compatibility fixes for Rails 1.2.x
241
+
242
+ == 0.2.1, 0.2.2
243
+
244
+ - Early releases, added better support for multiple databases
245
+
246
+ == 0.0.1
247
+
248
+ - Initial, very alpha release
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2006-2008 Nick Sieger <nick@nicksieger.com>
2
+ Copyright (c) 2006-2008 Ola Bini <ola.bini@gmail.com>
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,125 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ LICENSE.txt
6
+ lib/jdbc_adapter.rb
7
+ lib/pg.rb
8
+ lib/active_record/connection_adapters/cachedb_adapter.rb
9
+ lib/active_record/connection_adapters/derby_adapter.rb
10
+ lib/active_record/connection_adapters/h2_adapter.rb
11
+ lib/active_record/connection_adapters/hsqldb_adapter.rb
12
+ lib/active_record/connection_adapters/informix_adapter.rb
13
+ lib/active_record/connection_adapters/jdbc_adapter.rb
14
+ lib/active_record/connection_adapters/jdbc_adapter_spec.rb
15
+ lib/active_record/connection_adapters/jndi_adapter.rb
16
+ lib/active_record/connection_adapters/mysql_adapter.rb
17
+ lib/active_record/connection_adapters/oracle_adapter.rb
18
+ lib/active_record/connection_adapters/postgresql_adapter.rb
19
+ lib/active_record/connection_adapters/sqlite3_adapter.rb
20
+ lib/generators/jdbc/jdbc_generator.rb
21
+ lib/jdbc_adapter/jdbc_cachedb.rb
22
+ lib/jdbc_adapter/jdbc_db2.rb
23
+ lib/jdbc_adapter/jdbc_derby.rb
24
+ lib/jdbc_adapter/jdbc_firebird.rb
25
+ lib/jdbc_adapter/jdbc_hsqldb.rb
26
+ lib/jdbc_adapter/jdbc_informix.rb
27
+ lib/jdbc_adapter/jdbc_mimer.rb
28
+ lib/jdbc_adapter/jdbc_mssql.rb
29
+ lib/jdbc_adapter/jdbc_mysql.rb
30
+ lib/jdbc_adapter/jdbc_oracle.rb
31
+ lib/jdbc_adapter/jdbc_postgre.rb
32
+ lib/jdbc_adapter/jdbc_sqlite3.rb
33
+ lib/jdbc_adapter/jdbc_sybase.rb
34
+ lib/jdbc_adapter/missing_functionality_helper.rb
35
+ lib/jdbc_adapter/rake_tasks.rb
36
+ lib/jdbc_adapter/tsql_helper.rb
37
+ lib/jdbc_adapter/version.rb
38
+ lib/jdbc_adapter/jdbc_adapter_internal.jar
39
+ test/abstract_db_create.rb
40
+ test/cachedb_simple_test.rb
41
+ test/db2_simple_test.rb
42
+ test/derby_migration_test.rb
43
+ test/derby_multibyte_test.rb
44
+ test/derby_simple_test.rb
45
+ test/generic_jdbc_connection_test.rb
46
+ test/h2_simple_test.rb
47
+ test/has_many_through.rb
48
+ test/helper.rb
49
+ test/hsqldb_simple_test.rb
50
+ test/informix_simple_test.rb
51
+ test/jdbc_common.rb
52
+ test/jndi_callbacks_test.rb
53
+ test/jndi_test.rb
54
+ test/manualTestDatabase.rb
55
+ test/minirunit.rb
56
+ test/mssql_simple_test.rb
57
+ test/mysql_db_create_test.rb
58
+ test/mysql_multibyte_test.rb
59
+ test/mysql_nonstandard_primary_key_test.rb
60
+ test/mysql_simple_test.rb
61
+ test/oracle_simple_test.rb
62
+ test/pick_rails_version.rb
63
+ test/postgres_db_create_test.rb
64
+ test/postgres_mixed_case_test.rb
65
+ test/postgres_nonseq_pkey_test.rb
66
+ test/postgres_reserved_test.rb
67
+ test/postgres_schema_search_path_test.rb
68
+ test/postgres_simple_test.rb
69
+ test/simple.rb
70
+ test/sqlite3_simple_test.rb
71
+ test/sybase_jtds_simple_test.rb
72
+ test/activerecord/connection_adapters/type_conversion_test.rb
73
+ test/activerecord/connections/native_jdbc_mysql/connection.rb
74
+ test/db/cachedb.rb
75
+ test/db/db2.rb
76
+ test/db/derby.rb
77
+ test/db/h2.rb
78
+ test/db/hsqldb.rb
79
+ test/db/informix.rb
80
+ test/db/jdbc.rb
81
+ test/db/jndi_config.rb
82
+ test/db/logger.rb
83
+ test/db/mssql.rb
84
+ test/db/mysql.rb
85
+ test/db/oracle.rb
86
+ test/db/postgres.rb
87
+ test/db/sqlite3.rb
88
+ test/jdbc_adapter/jdbc_db2_test.rb
89
+ test/jdbc_adapter/jdbc_sybase_test.rb
90
+ test/minirunit/testConnect.rb
91
+ test/minirunit/testH2.rb
92
+ test/minirunit/testHsqldb.rb
93
+ test/minirunit/testLoadActiveRecord.rb
94
+ test/minirunit/testMysql.rb
95
+ test/minirunit/testRawSelect.rb
96
+ test/models/add_not_null_column_to_table.rb
97
+ test/models/auto_id.rb
98
+ test/models/data_types.rb
99
+ test/models/entry.rb
100
+ test/models/mixed_case.rb
101
+ test/models/reserved_word.rb
102
+ test/models/string_id.rb
103
+ test/models/validates_uniqueness_of_string.rb
104
+ lib/jdbc_adapter/jdbc.rake
105
+ src/java/jdbc_adapter/JdbcAdapterInternalService.java
106
+ src/java/jdbc_adapter/JdbcConnectionFactory.java
107
+ src/java/jdbc_adapter/JdbcDerbySpec.java
108
+ src/java/jdbc_adapter/JdbcMySQLSpec.java
109
+ src/java/jdbc_adapter/MssqlRubyJdbcConnection.java
110
+ src/java/jdbc_adapter/PostgresRubyJdbcConnection.java
111
+ src/java/jdbc_adapter/RubyJdbcConnection.java
112
+ src/java/jdbc_adapter/SQLBlock.java
113
+ src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java
114
+ rakelib/compile.rake
115
+ rakelib/package.rake
116
+ rakelib/rails.rake
117
+ rakelib/test.rake
118
+ rails_generators/jdbc_generator.rb
119
+ rails_generators/templates
120
+ rails_generators/templates/config
121
+ rails_generators/templates/lib
122
+ rails_generators/templates/config/initializers
123
+ rails_generators/templates/config/initializers/jdbc.rb
124
+ rails_generators/templates/lib/tasks
125
+ rails_generators/templates/lib/tasks/jdbc.rake
@@ -0,0 +1,218 @@
1
+ activerecord-jdbc-adapter is a database adapter for Rails' ActiveRecord
2
+ component that can be used with JRuby[http://www.jruby.org/]. It allows use of
3
+ virtually any JDBC-compliant database with your JRuby on Rails application.
4
+
5
+ == Project Info
6
+
7
+ * Mailing Lists: http://kenai.com/projects/activerecord-jdbc/lists
8
+ * Issues: http://kenai.com/jira/browse/ACTIVERECORD_JDBC
9
+ * Source: git://kenai.com/activerecord-jdbc~main
10
+ git://github.com/nicksieger/activerecord-jdbc-adapter.git
11
+
12
+ == Databases
13
+
14
+ What's there, and what is not there:
15
+
16
+ * MySQL - Complete support
17
+ * PostgreSQL - Complete support
18
+ * Oracle - Complete support
19
+ * Microsoft SQL Server - Complete support except for change_column_default
20
+ * DB2 - Complete, except for the migrations:
21
+ * change_column
22
+ * change_column_default
23
+ * remove_column
24
+ * rename_column
25
+ * add_index
26
+ * remove_index
27
+ * rename_table
28
+ * FireBird - Complete, except for change_column_default and rename_column
29
+ * Derby - Complete, except for:
30
+ * change_column
31
+ * change_column_default
32
+ * remove_column
33
+ * rename_column
34
+ * HSQLDB - Complete
35
+ * H2 - Complete
36
+ * SQLite3 - work in progress
37
+ * Informix - Fairly complete support, all tests pass and migrations appear to work. Comments welcome.
38
+
39
+ Other databases will require testing and likely a custom configuration module.
40
+ Please join the activerecord-jdbc
41
+ mailing-lists[http://kenai.com/projects/activerecord-jdbc/lists] to help us discover
42
+ support for more databases.
43
+
44
+ == Using ActiveRecord JDBC
45
+
46
+ === Inside Rails
47
+
48
+ To use activerecord-jdbc-adapter with JRuby on Rails:
49
+
50
+ 1. Choose the adapter you wish to gem install. The following pre-packaged
51
+ adapters are available:
52
+
53
+ * base jdbc (<tt>activerecord-jdbc-adapter</tt>). Supports all available databases via JDBC, but requires you to download and manually install the database vendor's JDBC driver .jar file.
54
+ * mysql (<tt>activerecord-jdbcmysql-adapter</tt>)
55
+ * postgresql (<tt>activerecord-jdbcpostgresql-adapter</tt>)
56
+ * sqlite3 (<tt>activerecord-jdbcsqlite3-adapter</tt>)
57
+ * derby (<tt>activerecord-jdbcderby-adapter</tt>)
58
+ * hsqldb (<tt>activerecord-jdbchsqldb-adapter</tt>)
59
+ * h2 (<tt>activerecord-jdbch2-adapter</tt>)
60
+
61
+ 2a. For Rails 3, if you're generating a new application, use the
62
+ following command to generate your application:
63
+
64
+ jruby -S rails myapp -m http://jruby.org/rails3.rb
65
+
66
+ 2b. Otherwise, you'll need to run the "jdbc" generator to prepare your
67
+ Rails application for JDBC.
68
+
69
+ If you're using Rails 3, first you'll need to modify your Gemfile
70
+ to use the activerecord-jdbc-adapter gem under JRuby. Change your
71
+ Gemfile to look like the following (using sqlite3 as an example):
72
+
73
+ if defined?(JRUBY_VERSION)
74
+ gem 'activerecord-jdbc-adapter', :require => false
75
+ gem 'jdbc-sqlite3, :require => false
76
+ else
77
+ gem sqlite3-ruby', :require => 'sqlite3'
78
+ end
79
+
80
+ Next, run the generator. With Rails 3:
81
+
82
+ jruby script/rails generate jdbc
83
+
84
+ With Rails 2:
85
+
86
+ jruby script/generate jdbc
87
+
88
+ The initializer and rake task files generated are guarded such that
89
+ they won't be loaded if you still run your application under C Ruby.
90
+
91
+ Legacy: If you're using Rails prior to version 2.0, you'll need to
92
+ add one-time setup to your config/environment.rb file in your Rails
93
+ application. Add the following lines just before the
94
+ <code>Rails::Initializer</code>. (If you're using
95
+ activerecord-jdbc-adapter under the old gem name used in versions
96
+ 0.5 and earlier (ActiveRecord-JDBC), replace
97
+ 'activerecord-jdbc-adapter' with 'ActiveRecord-JDBC' below.)
98
+
99
+ if RUBY_PLATFORM =~ /java/
100
+ require 'rubygems'
101
+ gem 'activerecord-jdbc-adapter'
102
+ require 'jdbc_adapter'
103
+ end
104
+
105
+ 3. Configure your database.yml in the normal Rails style.
106
+
107
+ Legacy configuration: If you use one of the convenience
108
+ 'activerecord-jdbcXXX-adapter' adapters, you can still put a 'jdbc'
109
+ prefix in front of the database adapter name as below.
110
+
111
+ development:
112
+ adapter: jdbcmysql
113
+ username: blog
114
+ password:
115
+ hostname: localhost
116
+ database: weblog_development
117
+
118
+ For other databases, you'll need to know the database driver class
119
+ and URL. Example:
120
+
121
+ development:
122
+ adapter: jdbc
123
+ username: blog
124
+ password:
125
+ driver: com.mysql.jdbc.Driver
126
+ url: jdbc:mysql://localhost:3306/weblog_development
127
+
128
+ For JNDI data sources, you may simply specify the database type
129
+ using the adapter key and the JNDI location as follows:
130
+
131
+ production:
132
+ adapter: mysql
133
+ jndi: jdbc/mysqldb
134
+
135
+ === Standalone, with ActiveRecord
136
+
137
+ 1. Install the gem with JRuby:
138
+
139
+ jruby -S gem install activerecord-jdbc-adapter
140
+
141
+ If you wish to use the adapter for a specific database, you can install it
142
+ directly and a driver gem will be installed as well:
143
+
144
+ jruby -S gem install activerecord-jdbcderby-adapter
145
+
146
+ 2. If using ActiveRecord 2.0 (Rails 2.0) or greater, you can skip to the next
147
+ step. Otherwise, ensure the following code gets executed in your script:
148
+
149
+ require 'rubygems'
150
+ gem 'activerecord-jdbc-adapter'
151
+ require 'jdbc_adapter'
152
+ require 'active_record'
153
+
154
+ 3. After this you can establish a JDBC connection like this:
155
+
156
+ ActiveRecord::Base.establish_connection(
157
+ :adapter => 'jdbcderby',
158
+ :database => "db/my-database"
159
+ )
160
+
161
+ or like this (but requires that you manually put the driver jar on the classpath):
162
+
163
+ ActiveRecord::Base.establish_connection(
164
+ :adapter => 'jdbc',
165
+ :driver => 'org.apache.derby.jdbc.EmbeddedDriver',
166
+ :url => 'jdbc:derby:test_ar;create=true'
167
+ )
168
+
169
+ == Getting the source
170
+
171
+ The source for activerecord-jdbc-adapter is available using git.
172
+
173
+ git clone git://github.com/nicksieger/activerecord-jdbc-adapter.git
174
+
175
+ == Feedback
176
+
177
+ Please file bug reports at
178
+ http://kenai.com/jira/browse/ACTIVERECORD_JDBC. If you're not sure if
179
+ something's a bug, feel free to pre-report it on the mailing lists.
180
+
181
+ == Running AR-JDBC's Tests
182
+
183
+ Drivers for 6 open-source databases are included. Provided you have MySQL
184
+ installed, you can simply type <tt>jruby -S rake</tt> to run the tests. A
185
+ database named <tt>weblog_development</tt> is needed beforehand with a
186
+ connection user of "blog" and an empty password.
187
+
188
+ If you also have PostgreSQL available, those tests will be run if the
189
+ `psql' executable can be found. Also ensure you have a database named
190
+ <tt>weblog_development</tt> and a user named "blog" and an empty
191
+ password.
192
+
193
+ If you want rails logging enabled during these test runs you can edit
194
+ test/jdbc_common.rb and add the following line:
195
+
196
+ require 'db/logger'
197
+
198
+ == Running AR Tests
199
+
200
+ To run the current AR-JDBC sources with ActiveRecord, just use the
201
+ included "rails:test" task. Be sure to specify a driver and a path to
202
+ the ActiveRecord sources.
203
+
204
+ jruby -S rake rails:test DRIVER=mysql RAILS=/path/activerecord_source_dir
205
+
206
+ == Authors
207
+
208
+ This project was written by Nick Sieger <nick@nicksieger.com> and Ola Bini
209
+ <olabini@gmail.com> with lots of help from the JRuby community.
210
+
211
+ == License
212
+
213
+ activerecord-jdbc-adapter is released under a BSD license. See the LICENSE file
214
+ included with the distribution for details.
215
+
216
+ Open-source driver gems for activerecord-jdbc-adapter are licensed under the
217
+ same license the database's drivers are licensed. See each driver gem's
218
+ LICENSE.txt file for details.