activerecord-jdbc-adapter 0.9.7-java → 1.0.0.beta1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -0
- data/Manifest.txt +71 -38
- data/lib/active_record/connection_adapters/cachedb_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/derby_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/h2_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/hsqldb_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/informix_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/jdbc_adapter.rb +1 -661
- data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/mysql_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -13
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -13
- data/lib/activerecord-jdbc-adapter.rb +2 -2
- data/lib/arjdbc.rb +29 -0
- data/lib/arjdbc/cachedb.rb +3 -0
- data/lib/arjdbc/cachedb/adapter.rb +20 -0
- data/lib/arjdbc/cachedb/connection_methods.rb +10 -0
- data/lib/arjdbc/db2.rb +2 -0
- data/lib/{jdbc_adapter/jdbc_db2.rb → arjdbc/db2/adapter.rb} +1 -17
- data/lib/arjdbc/derby.rb +7 -0
- data/lib/{jdbc_adapter/jdbc_derby.rb → arjdbc/derby/adapter.rb} +8 -26
- data/lib/arjdbc/derby/connection_methods.rb +18 -0
- data/lib/arjdbc/discover.rb +99 -0
- data/lib/arjdbc/firebird.rb +2 -0
- data/lib/{jdbc_adapter/jdbc_firebird.rb → arjdbc/firebird/adapter.rb} +12 -16
- data/lib/arjdbc/h2.rb +4 -0
- data/lib/arjdbc/h2/adapter.rb +15 -0
- data/lib/arjdbc/h2/connection_methods.rb +12 -0
- data/lib/arjdbc/hsqldb.rb +4 -0
- data/lib/{jdbc_adapter/jdbc_hsqldb.rb → arjdbc/hsqldb/adapter.rb} +6 -58
- data/lib/arjdbc/hsqldb/connection_methods.rb +14 -0
- data/lib/arjdbc/informix.rb +3 -0
- data/lib/{jdbc_adapter/jdbc_informix.rb → arjdbc/informix/adapter.rb} +6 -19
- data/lib/arjdbc/informix/connection_methods.rb +10 -0
- data/lib/arjdbc/jdbc.rb +2 -0
- data/lib/arjdbc/jdbc/adapter.rb +235 -0
- data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
- data/lib/arjdbc/jdbc/callbacks.rb +44 -0
- data/lib/arjdbc/jdbc/column.rb +38 -0
- data/lib/arjdbc/jdbc/compatibility.rb +51 -0
- data/lib/arjdbc/jdbc/connection.rb +97 -0
- data/lib/arjdbc/jdbc/connection_methods.rb +16 -0
- data/lib/arjdbc/jdbc/core_ext.rb +24 -0
- data/lib/arjdbc/jdbc/discover.rb +18 -0
- data/lib/arjdbc/jdbc/driver.rb +44 -0
- data/lib/arjdbc/jdbc/extension.rb +47 -0
- data/lib/arjdbc/jdbc/java.rb +14 -0
- data/lib/{jdbc_adapter → arjdbc/jdbc}/jdbc.rake +0 -0
- data/lib/{jdbc_adapter → arjdbc/jdbc}/missing_functionality_helper.rb +5 -5
- data/lib/arjdbc/jdbc/quoted_primary_key.rb +28 -0
- data/lib/{jdbc_adapter → arjdbc/jdbc}/railtie.rb +1 -1
- data/lib/{jdbc_adapter → arjdbc/jdbc}/rake_tasks.rb +0 -0
- data/lib/arjdbc/jdbc/require_driver.rb +16 -0
- data/lib/arjdbc/jdbc/type_converter.rb +119 -0
- data/lib/arjdbc/mimer.rb +2 -0
- data/lib/{jdbc_adapter/jdbc_mimer.rb → arjdbc/mimer/adapter.rb} +16 -19
- data/lib/arjdbc/mssql.rb +4 -0
- data/lib/{jdbc_adapter/jdbc_mssql.rb → arjdbc/mssql/adapter.rb} +19 -31
- data/lib/arjdbc/mssql/connection_methods.rb +13 -0
- data/lib/{jdbc_adapter → arjdbc/mssql}/tsql_helper.rb +1 -1
- data/lib/arjdbc/mysql.rb +4 -0
- data/lib/arjdbc/mysql/adapter.rb +388 -0
- data/lib/arjdbc/mysql/connection_methods.rb +26 -0
- data/lib/arjdbc/oracle.rb +3 -0
- data/lib/{jdbc_adapter/jdbc_oracle.rb → arjdbc/oracle/adapter.rb} +9 -17
- data/lib/arjdbc/oracle/connection_methods.rb +11 -0
- data/lib/arjdbc/postgresql.rb +4 -0
- data/lib/{jdbc_adapter/jdbc_postgre.rb → arjdbc/postgresql/adapter.rb} +7 -36
- data/lib/arjdbc/postgresql/connection_methods.rb +21 -0
- data/lib/arjdbc/sqlite3.rb +4 -0
- data/lib/{jdbc_adapter/jdbc_sqlite3.rb → arjdbc/sqlite3/adapter.rb} +106 -104
- data/lib/arjdbc/sqlite3/connection_methods.rb +33 -0
- data/lib/arjdbc/sybase.rb +2 -0
- data/lib/arjdbc/sybase/adapter.rb +46 -0
- data/lib/arjdbc/version.rb +8 -0
- data/lib/jdbc_adapter.rb +2 -27
- data/lib/jdbc_adapter/version.rb +3 -5
- data/rails_generators/templates/config/initializers/jdbc.rb +1 -1
- data/rakelib/compile.rake +3 -2
- data/rakelib/package.rake +3 -3
- data/src/java/{jdbc_adapter/JdbcDerbySpec.java → arjdbc/derby/DerbyModule.java} +32 -32
- data/src/java/{jdbc_adapter/JdbcAdapterInternalService.java → arjdbc/jdbc/AdapterJavaService.java} +13 -7
- data/src/java/{jdbc_adapter → arjdbc/jdbc}/JdbcConnectionFactory.java +6 -6
- data/src/java/{jdbc_adapter → arjdbc/jdbc}/RubyJdbcConnection.java +91 -16
- data/src/java/arjdbc/jdbc/SQLBlock.java +48 -0
- data/src/java/{jdbc_adapter → arjdbc/mssql}/MssqlRubyJdbcConnection.java +5 -2
- data/src/java/{jdbc_adapter/JdbcMySQLSpec.java → arjdbc/mysql/MySQLModule.java} +12 -12
- data/src/java/{jdbc_adapter/PostgresRubyJdbcConnection.java → arjdbc/postgresql/PostgresqlRubyJdbcConnection.java} +11 -9
- data/src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java +64 -0
- data/test/abstract_db_create.rb +4 -1
- data/test/activerecord/connection_adapters/type_conversion_test.rb +1 -1
- data/test/db/cachedb.rb +0 -0
- data/test/db/derby.rb +12 -14
- data/test/db/hsqldb.rb +3 -2
- data/test/db/jndi_config.rb +4 -4
- data/test/db/sqlite3.rb +2 -6
- data/test/db2_simple_test.rb +23 -0
- data/test/derby_migration_test.rb +50 -3
- data/test/jdbc_common.rb +1 -1
- data/test/jndi_callbacks_test.rb +1 -0
- data/test/postgres_nonseq_pkey_test.rb +0 -2
- data/test/postgres_schema_search_path_test.rb +0 -2
- data/test/simple.rb +3 -3
- data/test/sybase_jtds_simple_test.rb +22 -0
- metadata +82 -46
- data/lib/active_record/connection_adapters/jdbc_adapter_spec.rb +0 -26
- data/lib/jdbc_adapter/jdbc_adapter_internal.jar +0 -0
- data/lib/jdbc_adapter/jdbc_cachedb.rb +0 -33
- data/lib/jdbc_adapter/jdbc_mysql.rb +0 -260
- data/lib/jdbc_adapter/jdbc_sybase.rb +0 -50
- data/src/java/jdbc_adapter/SQLBlock.java +0 -27
- data/src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java +0 -41
- data/test/jdbc_adapter/jdbc_db2_test.rb +0 -26
- data/test/jdbc_adapter/jdbc_sybase_test.rb +0 -33
- data/test/minirunit.rb +0 -109
- data/test/minirunit/testConnect.rb +0 -14
- data/test/minirunit/testH2.rb +0 -73
- data/test/minirunit/testHsqldb.rb +0 -73
- data/test/minirunit/testLoadActiveRecord.rb +0 -3
- data/test/minirunit/testMysql.rb +0 -83
- data/test/minirunit/testRawSelect.rb +0 -24
data/test/minirunit/testMysql.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# To run this script, run the following in a mysql instance:
|
2
|
-
#
|
3
|
-
# drop database if exists weblog_development;
|
4
|
-
# create database weblog_development;
|
5
|
-
# grant all on weblog_development.* to blog@localhost;
|
6
|
-
|
7
|
-
require 'minirunit'
|
8
|
-
|
9
|
-
config = {
|
10
|
-
:username => 'blog',
|
11
|
-
:password => ''
|
12
|
-
}
|
13
|
-
|
14
|
-
if RUBY_PLATFORM =~ /java/
|
15
|
-
RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
|
16
|
-
config.update({
|
17
|
-
:adapter => 'jdbc',
|
18
|
-
:driver => 'com.mysql.jdbc.Driver',
|
19
|
-
:url => 'jdbc:mysql://localhost:3306/weblog_development',
|
20
|
-
})
|
21
|
-
else
|
22
|
-
config.update({
|
23
|
-
:adapter => 'mysql',
|
24
|
-
:database => 'weblog_development',
|
25
|
-
:host => 'localhost'
|
26
|
-
})
|
27
|
-
end
|
28
|
-
|
29
|
-
require 'active_record'
|
30
|
-
|
31
|
-
ActiveRecord::Base.establish_connection(config)
|
32
|
-
|
33
|
-
class CreateEntries < ActiveRecord::Migration
|
34
|
-
def self.up
|
35
|
-
create_table "entries", :force => true do |t|
|
36
|
-
t.column :title, :string, :limit => 100
|
37
|
-
t.column :updated_on, :datetime
|
38
|
-
t.column :content, :text
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.down
|
43
|
-
drop_table "entries"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
CreateEntries.up
|
48
|
-
|
49
|
-
test_ok ActiveRecord::Base.connection.tables.include?('entries')
|
50
|
-
|
51
|
-
class Entry < ActiveRecord::Base
|
52
|
-
end
|
53
|
-
|
54
|
-
Entry.delete_all
|
55
|
-
|
56
|
-
test_equal 0, Entry.count
|
57
|
-
|
58
|
-
TITLE = "First post!"
|
59
|
-
CONTENT = "Hello from JRuby on Rails!"
|
60
|
-
NEW_TITLE = "First post updated title"
|
61
|
-
|
62
|
-
post = Entry.new
|
63
|
-
post.title = TITLE
|
64
|
-
post.content = CONTENT
|
65
|
-
post.save
|
66
|
-
|
67
|
-
test_equal 1, Entry.count
|
68
|
-
|
69
|
-
post = Entry.find(:first)
|
70
|
-
test_equal TITLE, post.title
|
71
|
-
test_equal CONTENT, post.content
|
72
|
-
|
73
|
-
post.title = NEW_TITLE
|
74
|
-
post.save
|
75
|
-
|
76
|
-
post = Entry.find(:first)
|
77
|
-
test_equal NEW_TITLE, post.title
|
78
|
-
|
79
|
-
post.destroy
|
80
|
-
|
81
|
-
test_equal 0, Entry.count
|
82
|
-
|
83
|
-
CreateEntries.down
|
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'test/minirunit'
|
3
|
-
RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
|
4
|
-
require 'active_record'
|
5
|
-
|
6
|
-
connspec = ActiveRecord::Base.establish_connection(
|
7
|
-
:adapter => 'jdbc',
|
8
|
-
:driver => 'com.mysql.jdbc.Driver',
|
9
|
-
:url => 'jdbc:mysql://localhost:3306/weblog_development',
|
10
|
-
:username => 'blog',
|
11
|
-
:password => ''
|
12
|
-
)
|
13
|
-
|
14
|
-
connection = ActiveRecord::Base.connection
|
15
|
-
|
16
|
-
results = connection.execute "select * from entries"
|
17
|
-
|
18
|
-
test_equal results.length, 1
|
19
|
-
|
20
|
-
row = results.first
|
21
|
-
test_equal 'First post', row['title']
|
22
|
-
test_equal 'First post d00d!', row['content']
|
23
|
-
|
24
|
-
puts row.inspect
|