saturnflyer-activerecord-jdbc-adapter 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. data/.gitignore +16 -0
  2. data/History.txt +225 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.txt +161 -0
  5. data/Rakefile +28 -0
  6. data/VERSION +1 -0
  7. data/activerecord-jdbc-adapter.gemspec +277 -0
  8. data/adapters/derby/LICENSE.txt +21 -0
  9. data/adapters/derby/README.txt +5 -0
  10. data/adapters/derby/Rakefile +31 -0
  11. data/adapters/derby/lib/active_record/connection_adapters/jdbcderby_adapter.rb +30 -0
  12. data/adapters/h2/History.txt +0 -0
  13. data/adapters/h2/LICENSE.txt +21 -0
  14. data/adapters/h2/README.txt +5 -0
  15. data/adapters/h2/Rakefile +31 -0
  16. data/adapters/h2/lib/active_record/connection_adapters/jdbch2_adapter.rb +30 -0
  17. data/adapters/hsqldb/History.txt +0 -0
  18. data/adapters/hsqldb/LICENSE.txt +21 -0
  19. data/adapters/hsqldb/README.txt +5 -0
  20. data/adapters/hsqldb/Rakefile +31 -0
  21. data/adapters/hsqldb/lib/active_record/connection_adapters/jdbchsqldb_adapter.rb +30 -0
  22. data/adapters/mysql/History.txt +0 -0
  23. data/adapters/mysql/LICENSE.txt +21 -0
  24. data/adapters/mysql/README.txt +5 -0
  25. data/adapters/mysql/Rakefile +31 -0
  26. data/adapters/mysql/lib/active_record/connection_adapters/jdbcmysql_adapter.rb +30 -0
  27. data/adapters/postgresql/History.txt +0 -0
  28. data/adapters/postgresql/LICENSE.txt +21 -0
  29. data/adapters/postgresql/README.txt +5 -0
  30. data/adapters/postgresql/Rakefile +31 -0
  31. data/adapters/postgresql/lib/active_record/connection_adapters/jdbcpostgresql_adapter.rb +30 -0
  32. data/adapters/sqlite3/LICENSE.txt +21 -0
  33. data/adapters/sqlite3/README.txt +5 -0
  34. data/adapters/sqlite3/Rakefile +31 -0
  35. data/adapters/sqlite3/lib/active_record/connection_adapters/jdbcsqlite3_adapter.rb +30 -0
  36. data/bench/bench_attributes.rb +13 -0
  37. data/bench/bench_attributes_new.rb +14 -0
  38. data/bench/bench_create.rb +12 -0
  39. data/bench/bench_find_all.rb +12 -0
  40. data/bench/bench_find_all_mt.rb +25 -0
  41. data/bench/bench_model.rb +85 -0
  42. data/bench/bench_new.rb +12 -0
  43. data/bench/bench_new_valid.rb +12 -0
  44. data/bench/bench_valid.rb +13 -0
  45. data/drivers/derby/LICENSE.txt +1 -0
  46. data/drivers/derby/README.txt +6 -0
  47. data/drivers/derby/Rakefile +26 -0
  48. data/drivers/derby/lib/derby-10.5.3.0.jar +0 -0
  49. data/drivers/derby/lib/jdbc/derby.rb +11 -0
  50. data/drivers/h2/History.txt +0 -0
  51. data/drivers/h2/LICENSE.txt +2 -0
  52. data/drivers/h2/README.txt +6 -0
  53. data/drivers/h2/Rakefile +26 -0
  54. data/drivers/h2/lib/h2-1.1.107.jar +0 -0
  55. data/drivers/h2/lib/jdbc/h2.rb +10 -0
  56. data/drivers/hsqldb/History.txt +0 -0
  57. data/drivers/hsqldb/LICENSE.txt +2 -0
  58. data/drivers/hsqldb/README.txt +6 -0
  59. data/drivers/hsqldb/Rakefile +26 -0
  60. data/drivers/hsqldb/lib/hsqldb-1.8.0.7.jar +0 -0
  61. data/drivers/hsqldb/lib/jdbc/hsqldb.rb +10 -0
  62. data/drivers/mysql/History.txt +0 -0
  63. data/drivers/mysql/LICENSE.txt +1 -0
  64. data/drivers/mysql/README.txt +6 -0
  65. data/drivers/mysql/Rakefile +26 -0
  66. data/drivers/mysql/lib/jdbc/mysql.rb +10 -0
  67. data/drivers/mysql/lib/mysql-connector-java-5.0.4-bin.jar +0 -0
  68. data/drivers/postgres/History.txt +7 -0
  69. data/drivers/postgres/LICENSE.txt +12 -0
  70. data/drivers/postgres/README.txt +5 -0
  71. data/drivers/postgres/Rakefile +27 -0
  72. data/drivers/postgres/lib/jdbc/postgres.rb +25 -0
  73. data/drivers/postgres/lib/postgresql-8.3-604.jdbc3.jar +0 -0
  74. data/drivers/postgres/lib/postgresql-8.3-604.jdbc4.jar +0 -0
  75. data/drivers/sqlite3/LICENSE.txt +13 -0
  76. data/drivers/sqlite3/README.txt +6 -0
  77. data/drivers/sqlite3/Rakefile +26 -0
  78. data/drivers/sqlite3/lib/jdbc/sqlite3.rb +10 -0
  79. data/drivers/sqlite3/lib/sqlitejdbc-3.6.3.054.jar +0 -0
  80. data/lib/active_record/connection_adapters/cachedb_adapter.rb +1 -0
  81. data/lib/active_record/connection_adapters/derby_adapter.rb +13 -0
  82. data/lib/active_record/connection_adapters/h2_adapter.rb +13 -0
  83. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +13 -0
  84. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -0
  85. data/lib/active_record/connection_adapters/jdbc_adapter.rb +637 -0
  86. data/lib/active_record/connection_adapters/jdbc_adapter_spec.rb +14 -0
  87. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -0
  88. data/lib/active_record/connection_adapters/mysql_adapter.rb +13 -0
  89. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
  90. data/lib/active_record/connection_adapters/postgresql_adapter.rb +13 -0
  91. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +13 -0
  92. data/lib/jdbc_adapter.rb +27 -0
  93. data/lib/jdbc_adapter/jdbc.rake +104 -0
  94. data/lib/jdbc_adapter/jdbc_cachedb.rb +33 -0
  95. data/lib/jdbc_adapter/jdbc_db2.rb +191 -0
  96. data/lib/jdbc_adapter/jdbc_derby.rb +421 -0
  97. data/lib/jdbc_adapter/jdbc_firebird.rb +109 -0
  98. data/lib/jdbc_adapter/jdbc_hsqldb.rb +210 -0
  99. data/lib/jdbc_adapter/jdbc_informix.rb +147 -0
  100. data/lib/jdbc_adapter/jdbc_mimer.rb +141 -0
  101. data/lib/jdbc_adapter/jdbc_mssql.rb +333 -0
  102. data/lib/jdbc_adapter/jdbc_mysql.rb +233 -0
  103. data/lib/jdbc_adapter/jdbc_oracle.rb +374 -0
  104. data/lib/jdbc_adapter/jdbc_postgre.rb +483 -0
  105. data/lib/jdbc_adapter/jdbc_sqlite3.rb +360 -0
  106. data/lib/jdbc_adapter/jdbc_sybase.rb +50 -0
  107. data/lib/jdbc_adapter/missing_functionality_helper.rb +85 -0
  108. data/lib/jdbc_adapter/rake_tasks.rb +10 -0
  109. data/lib/jdbc_adapter/tsql_helper.rb +60 -0
  110. data/lib/jdbc_adapter/version.rb +5 -0
  111. data/pom.xml +57 -0
  112. data/rakelib/compile.rake +23 -0
  113. data/rakelib/package.rake +73 -0
  114. data/rakelib/rails.rake +41 -0
  115. data/src/java/jdbc_adapter/JdbcAdapterInternalService.java +53 -0
  116. data/src/java/jdbc_adapter/JdbcConnectionFactory.java +36 -0
  117. data/src/java/jdbc_adapter/JdbcDerbySpec.java +293 -0
  118. data/src/java/jdbc_adapter/JdbcMySQLSpec.java +133 -0
  119. data/src/java/jdbc_adapter/MssqlRubyJdbcConnection.java +71 -0
  120. data/src/java/jdbc_adapter/PostgresRubyJdbcConnection.java +55 -0
  121. data/src/java/jdbc_adapter/RubyJdbcConnection.java +1163 -0
  122. data/src/java/jdbc_adapter/SQLBlock.java +27 -0
  123. data/src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java +41 -0
  124. data/test/activerecord/connection_adapters/type_conversion_test.rb +31 -0
  125. data/test/activerecord/connections/native_jdbc_mysql/connection.rb +25 -0
  126. data/test/activerecord/jall.sh +7 -0
  127. data/test/activerecord/jtest.sh +3 -0
  128. data/test/cachedb_simple_test.rb +6 -0
  129. data/test/db/cachedb.rb +9 -0
  130. data/test/db/db2.rb +9 -0
  131. data/test/db/derby.rb +14 -0
  132. data/test/db/h2.rb +11 -0
  133. data/test/db/hsqldb.rb +12 -0
  134. data/test/db/informix.rb +11 -0
  135. data/test/db/jdbc.rb +11 -0
  136. data/test/db/jndi_config.rb +30 -0
  137. data/test/db/logger.rb +3 -0
  138. data/test/db/mssql.rb +9 -0
  139. data/test/db/mysql.rb +10 -0
  140. data/test/db/oracle.rb +34 -0
  141. data/test/db/postgres.rb +9 -0
  142. data/test/db/sqlite3.rb +15 -0
  143. data/test/db2_simple_test.rb +10 -0
  144. data/test/derby_migration_test.rb +21 -0
  145. data/test/derby_multibyte_test.rb +12 -0
  146. data/test/derby_simple_test.rb +12 -0
  147. data/test/generic_jdbc_connection_test.rb +9 -0
  148. data/test/h2_simple_test.rb +6 -0
  149. data/test/has_many_through.rb +79 -0
  150. data/test/hsqldb_simple_test.rb +6 -0
  151. data/test/informix_simple_test.rb +48 -0
  152. data/test/jdbc_adapter/jdbc_db2_test.rb +26 -0
  153. data/test/jdbc_adapter/jdbc_sybase_test.rb +33 -0
  154. data/test/jdbc_common.rb +24 -0
  155. data/test/jndi_callbacks_test.rb +38 -0
  156. data/test/jndi_test.rb +35 -0
  157. data/test/manualTestDatabase.rb +191 -0
  158. data/test/minirunit.rb +109 -0
  159. data/test/minirunit/testConnect.rb +14 -0
  160. data/test/minirunit/testH2.rb +73 -0
  161. data/test/minirunit/testHsqldb.rb +73 -0
  162. data/test/minirunit/testLoadActiveRecord.rb +3 -0
  163. data/test/minirunit/testMysql.rb +83 -0
  164. data/test/minirunit/testRawSelect.rb +24 -0
  165. data/test/models/add_not_null_column_to_table.rb +12 -0
  166. data/test/models/auto_id.rb +18 -0
  167. data/test/models/data_types.rb +28 -0
  168. data/test/models/entry.rb +23 -0
  169. data/test/models/mixed_case.rb +20 -0
  170. data/test/models/reserved_word.rb +18 -0
  171. data/test/mssql_simple_test.rb +6 -0
  172. data/test/mysql_multibyte_test.rb +10 -0
  173. data/test/mysql_nonstandard_primary_key_test.rb +43 -0
  174. data/test/mysql_simple_test.rb +26 -0
  175. data/test/oracle_simple_test.rb +29 -0
  176. data/test/postgres_mixed_case_test.rb +19 -0
  177. data/test/postgres_nonseq_pkey_test.rb +40 -0
  178. data/test/postgres_reserved_test.rb +22 -0
  179. data/test/postgres_simple_test.rb +12 -0
  180. data/test/simple.rb +397 -0
  181. data/test/sqlite3_simple_test.rb +179 -0
  182. data/test/sybase_jtds_simple_test.rb +6 -0
  183. metadata +294 -0
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ Manifest.txt
2
+ pkg
3
+ *.gem
4
+ *.tgz
5
+ derby*
6
+ lib/jdbc_adapter/jdbc_adapter_internal.jar
7
+ test.*
8
+ doc
9
+ build.xml
10
+ nbproject
11
+ TAGS
12
+ *~
13
+ *.log
14
+ patches*
15
+ *#
16
+ .stgit-edit.txt
data/History.txt ADDED
@@ -0,0 +1,225 @@
1
+ == 0.9.2
2
+
3
+ - Cleanup and reconnect if errors occur during begin/rollback
4
+ (Jean-Dominique Morani, Christian Seiler)
5
+ - ACTIVERECORD_JDBC-1: Add #drop_database method for oracle (does the
6
+ same thing as recreate_database)
7
+ - Sqlite3 and MSSQL fixes (Jean-Dominique Morani)
8
+ - JRUBY-3512: Treat LONGVARCHAR as a CLOB for Mssql
9
+ - JRUBY-3624: Upgrade Derby to 10.5.3.0 and add native limit/offset
10
+ support (Christopher Saunders)
11
+ - JRUBY-3616: Fix postgres non-sequence primary keys (David Kellum)
12
+ - JRUBY-3669: Fix Oracle case with unconfigured schema (Dan Powell)
13
+ - Fixed quote_column_name of jdbc_oracle to accept numbers (Marcelo
14
+ Murad)
15
+ - Fix for mysql tables with non standard primary keys such that the
16
+ schema dump is correct (Nick Zalabak)
17
+ - MSSQL fixes from Mike Luu:
18
+ - add support for MSSQL uniqueidentifier datatype
19
+ - always quote strings using unicode identifier for MSSQL
20
+ - Changes primary_key generation to use always instead of by default
21
+ for DB2 (Amos King)
22
+ - Improves the SQLite adapter by fixing rename_column, change_column,
23
+ change_column_default, changing remove_column, and adding
24
+ remove_columns (Ryan Baumann)
25
+
26
+ == 0.9.1
27
+
28
+ - We did a lot of internal cleanup this release in the hopes of
29
+ simplifying the code and increasing performance.
30
+ - Many SQLite updates (thanks Nils Christian Haugen)
31
+ - JRUBY-2912: Fix MSSQL create/drop database (Joern Hartmann)
32
+ - JRUBY-2767: Mistake in selecting identity with H2/HSQLDB
33
+ - JRUBY-2884: jdbc_postgre.rb issue handling nil booleans (also a fix
34
+ for hsqldb/h2) + tests
35
+ - JRUBY-2995: activerecord jdbc derby adapter should quote columns
36
+ called 'year'
37
+ - JRUBY-2897: jdbc_postgre.rb needs microsecond support
38
+ - JRUBY-3282: Upgrade to derby 10.4.2.0 to allow unique constraints
39
+ with nullable columns
40
+ - Update h2 from 1.0.63 to 1.1.107 in driver
41
+ - JRUBY-3026: [Derby] Allow select/delete/update conditions with
42
+ comparison to NULL using '='
43
+ - JRUBY-2996: ...(actually this fixes only remaining issue of this bug
44
+ which was symbols making into quote were exploding
45
+ - JRUBY-2691: Update sybase driver to pass simple unit tests with jtds
46
+ and verify it works with the new dialect keyword. patch by Leigh
47
+ Kennedy
48
+ - Make :float type work on h2,hsql [returned as string]. Make :float
49
+ work on hsqldb (no paren value supported). Make REAL_TYPE just
50
+ return RubyFloat
51
+ - JRUBY-3222: Upgrade #type_to_sql to variation of AR 2.1.2 version
52
+ - Add patch supplied in JRUBY-3489 (patch by Jean-Dominique Morani)
53
+ - Various Oracle fixes by edsono
54
+ - JRUBY-2688: Don't hard-code MySQL connection character encoding to
55
+ utf8
56
+
57
+ == 0.9
58
+
59
+ - Now updated to support ActiveRecord 2.2. JNDI-based connections will
60
+ automatically connect/disconnect for every AR connection pool
61
+ checkout/checkin. For best results, set your pool: parameter >= the
62
+ actual maximum size of the JNDI connection pool. (We'll look at how
63
+ to eliminate the need to configure AR's pool in the future.)
64
+ - NEW! Informix support courtesy of Javier Fernandez-Ivern.
65
+ - Backport another Oracle CLOB issue, thanks Edson C�sar.
66
+ - Rubyforge #22018: chomp final trailing semicolon for oracle
67
+ - JRUBY-2848: Fix NPE error in set_native_database_types
68
+ - Rework oracle lob saving callback to be Rails 2.1 friendly (assist
69
+ from court3nay)
70
+ - JRUBY-2715: Add create/drop database methods to Postgres (Peter Williams)
71
+ - JRUBY-3183: Fix structure dump for Postgres (Ryan Bell)
72
+ - JRUBY-3184: recreate_database for test database working for PG (Ryan Bell)
73
+ - JRUBY-3186: disable referential integrity for PG (Ryan Bell)
74
+ - Authoritative repository now hosted at
75
+ git://github.com/nicksieger/activerecord-jdbc-adapter.git; rubyforge
76
+ svn trunk cleaned out.
77
+
78
+ == 0.8.2
79
+
80
+ - Added an optional config key called :dialect. Using :dialect allows you to
81
+ override the default SQL dialect for the driver class being used. There are
82
+ a few cases for this:
83
+ - Using using Sybase w/ the jTDS driver.
84
+ - Using rebranded drivers.
85
+ - It makes more sense to use :dialect, rather then :driver when using JNDI.
86
+ - JRUBY-2619: Typo with :test config causing problems with dev database (Igor Minar)
87
+ - 20524, JRUBY-2612: Since when did I think that there was a #true? method on Object?
88
+
89
+ == 0.8.1
90
+
91
+ - Now sporting a JDBC sqlite3 adapter! Thanks Joseph Athman.
92
+ - Added support for InterSystems Cache database (Ryan Bell)
93
+ - Fix for JRUBY-2256
94
+ - JRUBY-1638, JRUBY-2404, JRUBY-2463: schema.table handling and Oracle NUMBER fixes (Darcy Schultz & Jesse Hu)
95
+ - Add structure dump and other DDL-ish for DB2 (courtesy abedra and stuarthalloway)
96
+ - Fix missing quote_table_name function under Rails 1.2.6 and earlier
97
+ - Small tweaks to jdbc.rake to select proper config
98
+ - JRUBY-2011: Fix MSSQL string un-quoting issue (Silvio Fonseca)
99
+ - JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
100
+ - 20479: Improve get_table_name for MSSQL (Aslak Hellesøy)
101
+ - 20243: numerics improvements for MSSQL (Aslak Hellesøy)
102
+ - 20172: don't quote table names for MSSQL (Thor Marius Henrichsen)
103
+ - 19729: check for primary key existence in postgres during insert (Martin Luder)
104
+ - JRUBY-2297, 18846: retrying failing SQL statements is harmful when not autocommitting (Craig McMillan)
105
+ - 10021: very preliminary sybase support. (Mark Atkinson) Not usable until collision w/ sqlserver driver is resolved.
106
+ - JRUBY-2312, JRUBY-2319, JRUBY-2322: Oracle timestamping issues (Jesse Hu & Michael König)
107
+ - JRUBY-2422: Fix MySQL referential integrity and rollback issues
108
+ - JRUBY-2382: mysql string quoting fails with ArrayIndexOutofBoundsException
109
+
110
+ == 0.8
111
+
112
+ - NOTE: This release is only compatible with JRuby 1.1RC3 or later.
113
+ - Because of recent API changes in trunk in preparation for JRuby 1.1, this release is not
114
+ backward compatible with previous JRuby releases. Hence the version bump.
115
+ - Internal: convert Java methods to be defined with annotations
116
+ - Fix problem with reserved words coming back pre-quoted from #indexes in postgres
117
+ - JRUBY-2205: Fix N^2 allocation of bytelists for mysql quoting (taw)
118
+ - Attempt a fix for Rubyforge 18059
119
+ - Upgrade derby to 10.3.2.1
120
+ - Fix db:create etc. in the case where JDBC is loaded in Rails' preinitializer.rb
121
+ - Fix db:drop to actually work
122
+ - Fix for Rubyforge #11567 (Matt Williams)
123
+
124
+ == 0.7.2
125
+
126
+ - JRUBY-1905: add_column for derby, hsqldb, and postgresql (Stephen Bannasch)
127
+ - Fix db:create for JDBC
128
+ - Support Rails 2 with the old "require 'jdbc_adapter'" approach
129
+ - JRUBY-1966: Instead of searching for just tables, search for views and tables.
130
+ - JRUBY-1583: DB2 numeric quoting (Ryan Shillington)
131
+ - JRUBY-1634: Oracle DATE type mapping (Daniel Wintschel)
132
+ - JRUBY-1543: rename_column issue with more recent MySQL drivers (Oliver Schmelzle)
133
+ - Rubyforge #15074: ConnectionAdapters::JdbcAdapter.indexes is missing name and
134
+ schema_name parameters in the method signature (Igor Minar)
135
+ - Rubyforge #13558: definition for the indexes method (T Meyarivan)
136
+ - JRUBY-2051: handle schemaname and tablename more correctly for columns
137
+ - JRUBY-2102: Postgres Adapter cannot handle datetime type (Rainer Hahnekamp)
138
+ - JRUBY-2018: Oracle behind ActiveRecord-JDBC fails with "Invalid column index" (K Venkatasubramaniyan)
139
+ - JRUBY-2012: jdbc_mysql structure dump fails for mysql views (Tyler Jennings)
140
+
141
+ == 0.7.1
142
+
143
+ - Add adapter and driver for H2 courtesy of Caleb Land
144
+ - Fix "undefined method `last' for {}:Hash" error introduced with new Rake 0.8.1 (JRUBY-1859)
145
+
146
+ == 0.7
147
+
148
+ - PLEASE NOTE: This release is not compatible with JRuby releases earlier than
149
+ 1.0.3 or 1.1b2. If you must use JRuby 1.0.2 or earlier, please install the
150
+ 0.6 release.
151
+ - Release coincides with JRuby 1.0.3 and JRuby 1.1b2 releases
152
+ - Simultaneous support for JRuby trunk and 1.0 branch
153
+ - Get rid of log_no_bench method, so we time SQL execution again.
154
+ - Implement #select_rows
155
+ - MySQL migration and quoting updates
156
+
157
+ == 0.6
158
+
159
+ - Gem is renamed to "activerecord-jdbc-adapter" to follow new conventions
160
+ introduced in Rails 2.0 for third-party adapters. Rails 2.0 compatibility is
161
+ introduced.
162
+ - Add dependency on ActiveRecord >= 1.14 (from the Rails 1.1.x release)
163
+ - New drivers (jdbc-XXX) and adapter (activerecord-jdbcXXX-adapter) gems
164
+ available separately. See the README.txt file for details.
165
+ - Plain "jdbc" driver is still available if you want to use the full
166
+ driver/url way of specifying the driver.
167
+ - More bugfixes to Oracle and SQLServer courtesy of Ola & ThoughtWorks
168
+
169
+ == 0.5
170
+
171
+ - Release coincides with JRuby 1.0.1 release
172
+ - It is no longer necessary to specify :driver and :url configuration
173
+ parameters for the mysql, postgresql, oracle, derby, hsqldb, and h2
174
+ adapters. The previous configuration is still valid and compatible, but for
175
+ new applications, this makes it possible to use the exact same database.yml
176
+ configuration as Rails applications running under native Ruby.
177
+ - JDBC drivers can now be dynamically loaded by Ruby code, without being on
178
+ the classpath prior to launching JRuby. Simply use "require
179
+ 'jdbc-driver.jar'" in JRuby code to add it to the runtime classpath.
180
+ - Updates to HSQL, MS SQLServer, Postgres, Oracle and Derby adapters
181
+
182
+ == 0.4
183
+
184
+ - Release coincides with JRuby 1.0 release
185
+ - Shoring up PostgreSQL (courtesy Dudley Flanders) and HSQL (courtesy Matthew
186
+ Williams)
187
+ - Fix timestamps on Oracle to use DATE (as everything else)
188
+ - Derby fixes: Fix for open result set issue, better structure dump, quoting,
189
+ column type changing
190
+ - Sybase type recognition fix (courtesy Dean Mao)
191
+
192
+ == 0.3.1
193
+
194
+ - Derby critical fixes shortly after 0.3
195
+
196
+ == 0.3
197
+
198
+ - Release coincides with JRuby 1.0.0RC1 release
199
+ - Improvements for Derby, Postgres, and Oracle, all of which are running
200
+ > 95% of AR tests
201
+
202
+ == 0.2.4
203
+
204
+ - Release coincides with JRuby 0.9.9 release
205
+ - JRuby 0.9.9 is required
206
+ - MySQL close to 100% working
207
+ - Derby improvements
208
+ - DECIMAL/NUMERIC/FLOAT/REAL bugs fixed with type recognition for Oracle,
209
+ Postgres, etc.
210
+ - HSQLDB has regressed this release and may not be functioning; we'll get it
211
+ fixed for the next one
212
+
213
+ == 0.2.3
214
+
215
+ - Release coincides (and compatible) with JRuby 0.9.8 release
216
+ - 8 bugs fixed: see http://rubyurl.com/0Da
217
+ - Improvements and compatibility fixes for Rails 1.2.x
218
+
219
+ == 0.2.1, 0.2.2
220
+
221
+ - Early releases, added better support for multiple databases
222
+
223
+ == 0.0.1
224
+
225
+ - Initial, very alpha release
data/LICENSE.txt ADDED
@@ -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.
data/README.txt ADDED
@@ -0,0 +1,161 @@
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
+ == Databases
6
+
7
+ What's there, and what is not there:
8
+
9
+ * MySQL - Complete support
10
+ * PostgreSQL - Complete support
11
+ * Oracle - Complete support
12
+ * Microsoft SQL Server - Complete support except for change_column_default
13
+ * DB2 - Complete, except for the migrations:
14
+ * change_column
15
+ * change_column_default
16
+ * remove_column
17
+ * rename_column
18
+ * add_index
19
+ * remove_index
20
+ * rename_table
21
+ * FireBird - Complete, except for change_column_default and rename_column
22
+ * Derby - Complete, except for:
23
+ * change_column
24
+ * change_column_default
25
+ * remove_column
26
+ * rename_column
27
+ * HSQLDB - Complete
28
+ * H2 - Complete
29
+ * SQLite3 - work in progress
30
+ * Informix - Fairly complete support, all tests pass and migrations appear to work. Comments welcome.
31
+
32
+ Other databases will require testing and likely a custom configuration module.
33
+ Please join the activerecord-jdbc
34
+ mailing-lists[http://kenai.com/projects/activerecord-jdbc/lists] to help us discover
35
+ support for more databases.
36
+
37
+ == Using ActiveRecord JDBC
38
+
39
+ === Inside Rails
40
+
41
+ To use activerecord-jdbc-adapter with JRuby on Rails:
42
+
43
+ 1. Choose the adapter you wish to gem install. The following pre-packaged
44
+ adapters are available:
45
+
46
+ * 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.
47
+ * mysql (<tt>activerecord-jdbcmysql-adapter</tt>)
48
+ * postgresql (<tt>activerecord-jdbcpostgresql-adapter</tt>)
49
+ * derby (<tt>activerecord-jdbcderby-adapter</tt>)
50
+ * hsqldb (<tt>activerecord-jdbchsqldb-adapter</tt>)
51
+ * h2 (<tt>activerecord-jdbch2-adapter</tt>)
52
+
53
+ 2. If you're using Rails 2.0, you may skip to the next step. For Rails prior to
54
+ version 2.0, you'll need to add one-time setup to your config/environment.rb
55
+ file in your Rails application. Add the following lines just before the
56
+ <code>Rails::Initializer</code>. (If you're using activerecord-jdbc-adapter
57
+ under the old gem name used in versions 0.5 and earlier (ActiveRecord-JDBC),
58
+ replace 'activerecord-jdbc-adapter' with 'ActiveRecord-JDBC' below.)
59
+
60
+ if RUBY_PLATFORM =~ /java/
61
+ require 'rubygems'
62
+ gem 'activerecord-jdbc-adapter'
63
+ require 'jdbc_adapter'
64
+ end
65
+
66
+ 3. Configure your database.yml to use the <code>jdbc</code> adapter. For mysql,
67
+ postgres, derby, oracle, hsqldb, h2, and informix you can simply configure
68
+ the database in the normal Rails style. If you use one of the convenience
69
+ 'activerecord-jdbcXXX-adapter' adapters, be sure and put a 'jdbc' prefix in
70
+ front of the databas adapter name as below.
71
+
72
+ development:
73
+ adapter: jdbcmysql
74
+ username: blog
75
+ password:
76
+ hostname: localhost
77
+ database: weblog_development
78
+
79
+ For other databases, you'll need to know the database driver class and URL.
80
+ Example:
81
+
82
+ development:
83
+ adapter: jdbc
84
+ username: blog
85
+ password:
86
+ driver: com.mysql.jdbc.Driver
87
+ url: jdbc:mysql://localhost:3306/weblog_development
88
+
89
+ === Standalone, with ActiveRecord
90
+
91
+ 1. Install the gem with JRuby:
92
+
93
+ jruby -S gem install activerecord-jdbc-adapter
94
+
95
+ If you wish to use the adapter for a specific database, you can install it
96
+ directly and a driver gem will be installed as well:
97
+
98
+ jruby -S gem install activerecord-jdbcderby-adapter
99
+
100
+ 2. If using ActiveRecord 2.0 (Rails 2.0) or greater, you can skip to the next
101
+ step. Otherwise, ensure the following code gets executed in your script:
102
+
103
+ require 'rubygems'
104
+ gem 'activerecord-jdbc-adapter'
105
+ require 'jdbc_adapter'
106
+ require 'active_record'
107
+
108
+ 3. After this you can establish a JDBC connection like this:
109
+
110
+ ActiveRecord::Base.establish_connection(
111
+ :adapter => 'jdbcderby',
112
+ :database => "db/my-database"
113
+ )
114
+
115
+ or like this (but requires that you manually put the driver jar on the classpath):
116
+
117
+ ActiveRecord::Base.establish_connection(
118
+ :adapter => 'jdbc',
119
+ :driver => 'org.apache.derby.jdbc.EmbeddedDriver',
120
+ :url => 'jdbc:derby:test_ar;create=true'
121
+ )
122
+
123
+ == Getting the source
124
+
125
+ The source for activerecord-jdbc-adapter is available using git.
126
+
127
+ git clone git://github.com/nicksieger/activerecord-jdbc-adapter.git
128
+
129
+ == Running AR-JDBC's Tests
130
+
131
+ Drivers for 4 open-source databases are included. Provided you have MySQL
132
+ installed, you can simply type <tt>jruby -S rake</tt> to run the tests. A
133
+ database named <tt>weblog_development</tt> is needed beforehand with a
134
+ connection user of "blog" and password empty.
135
+
136
+ If you want rails logging enabled during these test runs you can edit
137
+ test/jdbc_common.rb and add the following line:
138
+
139
+ require 'db/logger'
140
+
141
+ == Running AR Tests
142
+
143
+ # If you want to run MRI against Rails remember to re-export RUBYLIB to be
144
+ # empty (or whatever you normally have it set to when you are done).
145
+ export RUBYLIB=$(find $PWD -name lib -type d | grep -v pkg | ruby -e 'puts $stdin.readlines.map{|l| l.chomp}.join(":")')
146
+ cd active_record_source_dir
147
+ jruby -S rake test_jdbcmysql (or specific adapter you want to test)
148
+
149
+ == Authors
150
+
151
+ This project was written by Nick Sieger <nick@nicksieger.com> and Ola Bini
152
+ <olabini@gmail.com> with lots of help from the JRuby community.
153
+
154
+ == License
155
+
156
+ activerecord-jdbc-adapter is released under a BSD license. See the LICENSE file
157
+ included with the distribution for details.
158
+
159
+ Open-source driver gems for activerecord-jdbc-adapter are licensed under the
160
+ same license the database's drivers are licensed. See each driver gem's
161
+ LICENSE.txt file for details.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ require 'rake/testtask'
5
+ require 'rake/clean'
6
+ CLEAN.include 'derby*', 'test.db.*','test/reports', 'test.sqlite3','lib/**/*.jar','manifest.mf', '*.log'
7
+
8
+ begin
9
+ require 'jeweler'
10
+ Jeweler::Tasks.new do |gem|
11
+ gem.name = "activerecord-jdbc-adapter"
12
+ gem.summary = %Q{JDBC adapter for ActiveRecord, for use within JRuby on Rails.}
13
+ gem.description = %Q{JDBC adapter for ActiveRecord, for use within JRuby on Rails.}
14
+ gem.email = "nick@nicksieger.com, ola.bini@gmail.com"
15
+ gem.homepage = "http://github.com/saturnflyer/activerecord-jdbc-adapter"
16
+ gem.authors = ["Nick Sieger", "Ola Bini", "JRuby contributors"]
17
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
+ end
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
21
+ end
22
+
23
+ task :default => [:java_compile, :test]
24
+
25
+ task :filelist do
26
+ puts FileList['pkg/**/*'].inspect
27
+ end
28
+