trinidad_mssql_dbpool_extension 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +32 -0
- data/LICENSE +6 -1
- data/README.rdoc +67 -29
- data/Rakefile +75 -0
- data/lib/trinidad_mssql_dbpool_extension.rb +1 -1
- data/trinidad-libs/jtds-1.2.7.jar +0 -0
- metadata +14 -48
- data/VERSION +0 -1
- data/trinidad-libs/jtds-1.2.5.jar +0 -0
data/History.txt
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
== 0.4.0 (2012-05-31)
|
2
|
+
|
3
|
+
* revised trinidad_generic_dbpool_extension :
|
4
|
+
- driver configuration option aliased as driverName
|
5
|
+
- new driverPath option for specifying driver jar in configuration
|
6
|
+
- allow driverName to be auto resolved when driverPath specified
|
7
|
+
* trinidad_postgresql_dbpool_extension with driver updated to 9.1-902
|
8
|
+
* trinidad_mysql_dbpool_extension with mysql-connector-j 5.1.20
|
9
|
+
* code cleanup, get rid of jeweler, update tomcat-dbcp.jar for trinidad_dbpool
|
10
|
+
|
11
|
+
== 0.3.0 (2011-07-01)
|
12
|
+
|
13
|
+
* Oracle connection pool extension
|
14
|
+
* Mssql connection pool extension
|
15
|
+
* Postgresql syntax error fix
|
16
|
+
* Add support for multiple pools per db extension
|
17
|
+
|
18
|
+
== 0.2.0 (2010-07-29)
|
19
|
+
|
20
|
+
* Update trinidad_dbpool_extension common gem to support Tomcat 7
|
21
|
+
|
22
|
+
== 0.1.1 (2010-05-05)
|
23
|
+
|
24
|
+
* Update trinidad_dbpool_extension common gem
|
25
|
+
* Remove adding jndi context and resource to the global tomcat context
|
26
|
+
|
27
|
+
== 0.1.0 (2010-04-04)
|
28
|
+
|
29
|
+
* First release
|
30
|
+
* General connection pool extension
|
31
|
+
* Mysql connection pool extension
|
32
|
+
* Postgresql connection pool extension
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2012 Team Trinidad and contributors http://github.com/trinidad
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -18,3 +18,8 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
== JDBC Driver
|
23
|
+
|
24
|
+
Included JDBC drivers are most likely distributed under different terms than
|
25
|
+
those above, please make sure you understand your driver's license terms.
|
data/README.rdoc
CHANGED
@@ -1,45 +1,84 @@
|
|
1
1
|
= trinidad-dbpool
|
2
2
|
|
3
|
-
Trinidad extensions to support database connection
|
4
|
-
container.
|
3
|
+
Trinidad extensions to support database connection pooling on top of the
|
4
|
+
underlying Apache Tomcat container.
|
5
5
|
|
6
|
-
|
6
|
+
Please note, that such pools are usually configured as "global" and thus
|
7
|
+
shareable by multiple applications deployed on to of Trinidad server.
|
7
8
|
|
8
|
-
|
9
|
+
== Available Pools
|
10
|
+
|
11
|
+
* MySQL (trinidad_mysql_dbpool_extension)
|
9
12
|
* PostgreSQL (trinidad_postgresql_dbpool_extension)
|
10
|
-
*
|
13
|
+
* MS-SQL (trinidad_mssql_dbpool_extension) using (unofficial) jTDS driver
|
11
14
|
* Oracle (trinidad_oracle_dbpool_extension)
|
15
|
+
* Generic (trinidad_generic_dbpool_extension) in case your DB ain't supported
|
12
16
|
|
13
17
|
== Usage
|
14
18
|
|
15
|
-
* Install the
|
16
|
-
* Configure the pool
|
19
|
+
* Install the gem e.g. `jruby -S gem install trinidad_mysql_dbpool_extension`
|
20
|
+
* Configure the pool with Trinidad's configuration file e.g. :
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
_jndi_, _username_, _password_ and _url_ are mandatory,
|
31
|
-
configuration options
|
22
|
+
web_apps:
|
23
|
+
default:
|
24
|
+
extensions:
|
25
|
+
mysql_dbpool: # EXTENSION NAME AS KEY
|
26
|
+
jndi: 'jdbc/TestDB' # JNDI name
|
27
|
+
username: 'root' # database username
|
28
|
+
password: 'root' # database password
|
29
|
+
url: 'localhost:3306/javatest' # database URL (or full jdbc: URL)
|
30
|
+
maxActive: 100 # max nodes actives
|
31
|
+
maxIdle: 30 # max nodes idles
|
32
|
+
maxWait: 10000 # max nodes waiting
|
33
|
+
|
34
|
+
_jndi_, _username_, _password_ and _url_ are mandatory,
|
35
|
+
while other supported configuration options might be found here:
|
32
36
|
|
33
37
|
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
|
34
38
|
|
35
39
|
http://commons.apache.org/dbcp/configuration.html
|
36
40
|
|
37
|
-
* Configure your rails application to use
|
41
|
+
* Configure your rails application to use JNDI into the config/database.yml
|
42
|
+
|
43
|
+
production:
|
44
|
+
adapter: jdbc
|
45
|
+
jndi: java:/comp/env/jdbc/TestDB
|
46
|
+
driver: com.mysql.jdbc.Driver # JDBC driver is mandatory here
|
47
|
+
|
48
|
+
== Generic Pool
|
49
|
+
|
50
|
+
If there's no "official" pool for your database, or would like to use a
|
51
|
+
different version of a JDBC driver for a supported Trinidad pool, this allows
|
52
|
+
you to completely customize a pool.
|
53
|
+
|
54
|
+
NOTE: You will need a JDBC driver for your database, check the driver DB if
|
55
|
+
unsure about how to get one http://developers.sun.com/product/jdbc/drivers
|
56
|
+
|
57
|
+
Sample configuration for a DB2 database :
|
58
|
+
|
59
|
+
---
|
60
|
+
extensions:
|
61
|
+
generic_dbpool: # EXTENSION NAME AS KEY
|
62
|
+
jndi: 'jdbc/MyDB' # JNDI name
|
63
|
+
url: 'jdbc:db2://127.0.0.1:50000/MYDB' # specify full jdbc: URL
|
64
|
+
username: 'mydb' # database username
|
65
|
+
password: 'pass' # database password
|
66
|
+
driverPath: '/opt/IBM/DB2/db2jcc4.jar' # leave out if it's on class-path
|
67
|
+
driverName: com.ibm.db2.jcc.DB2Driver # might resolve from driverPath
|
68
|
+
|
69
|
+
Beyond standard configuration options there's 2 specific options here :
|
70
|
+
|
71
|
+
* _driverPath_ should be a path to your JDBC driver archive, if you're using a
|
72
|
+
--libs jar folder with trinidad, might leave that out but make sure it's on
|
73
|
+
the class-path for each and every deployed application that requires it.
|
74
|
+
|
75
|
+
Also in case driverPath: is ommited you'll need to specify a driverName: !
|
38
76
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
77
|
+
* _driverName_ the class name implementing the JDBC driver interface, if you're
|
78
|
+
not sure check the .jar for a META-INF/services/java.sql.Driver file. If
|
79
|
+
present that file contains the class-name and you might leave driverName:
|
80
|
+
blank if you specified the jar path using driverPath: but you're going still
|
81
|
+
going to need the driver name in your database.yml
|
43
82
|
|
44
83
|
== Note on Patches/Pull Requests
|
45
84
|
|
@@ -47,10 +86,9 @@ http://commons.apache.org/dbcp/configuration.html
|
|
47
86
|
* Make your feature addition or bug fix.
|
48
87
|
* Add tests for it. This is important so I don't break it in a
|
49
88
|
future version unintentionally.
|
50
|
-
* Commit, do not mess with rakefile, version, or history.
|
51
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
52
89
|
* Send me a pull request. Bonus points for topic branches.
|
53
90
|
|
54
91
|
== Copyright
|
55
92
|
|
56
|
-
Copyright (c)
|
93
|
+
Copyright (c) 2012 [Team Trinidad](https://github.com/trinidad).
|
94
|
+
See LICENSE (http://en.wikipedia.org/wiki/MIT_License) for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
def build(gem)
|
5
|
+
mkdir_p 'pkg'
|
6
|
+
sh "gem build #{gem}.gemspec"
|
7
|
+
mv Dir["#{gem}*.gem"].last, 'pkg'
|
8
|
+
end
|
9
|
+
|
10
|
+
def release(gem, version = nil)
|
11
|
+
unless `git branch` =~ /^\* master$/
|
12
|
+
raise "must be on master to release !"
|
13
|
+
end
|
14
|
+
|
15
|
+
if version
|
16
|
+
unless gem_file = Dir.glob("pkg/#{gem}-#{version}.gem").first
|
17
|
+
raise "#{gem}-#{version}.gem not build !"
|
18
|
+
end
|
19
|
+
else
|
20
|
+
unless gem_file = Dir.glob("pkg/#{gem}*").sort.last
|
21
|
+
raise "#{gem}*.gem not build !"
|
22
|
+
end
|
23
|
+
unless match = gem_file.match(/.*?\-(\d\.\d\.\d)\.gem/)
|
24
|
+
raise "version number not matched from: #{gem_file}"
|
25
|
+
end
|
26
|
+
version = match[1]
|
27
|
+
end
|
28
|
+
|
29
|
+
sh "git tag #{gem}-#{version}"
|
30
|
+
sh "git push origin master --tags"
|
31
|
+
sh "gem push #{gem_file}"
|
32
|
+
end
|
33
|
+
|
34
|
+
all_gems = %W{
|
35
|
+
dbpool
|
36
|
+
generic_dbpool_extension
|
37
|
+
mysql_dbpool_extension
|
38
|
+
postgresql_dbpool_extension
|
39
|
+
mssql_dbpool_extension
|
40
|
+
oracle_dbpool_extension
|
41
|
+
}
|
42
|
+
all_gems.map! { |gem| "trinidad_#{gem}" }
|
43
|
+
all_gems.each do |gem_name|
|
44
|
+
namespace gem_name do
|
45
|
+
desc "Build the #{gem_name} gem"
|
46
|
+
task :build do
|
47
|
+
build(gem_name)
|
48
|
+
end
|
49
|
+
desc "Release the #{gem_name} gem"
|
50
|
+
task :release => :build do
|
51
|
+
release(gem_name)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
{
|
57
|
+
:build => 'Build all connection pool gems',
|
58
|
+
:release => 'Release all connection pool gems'
|
59
|
+
}.each do |t, d|
|
60
|
+
desc d
|
61
|
+
task t => all_gems.map { |name| "#{name}:#{t}" } # e.g. mysql_dbpool:build
|
62
|
+
end
|
63
|
+
|
64
|
+
desc "Clear out all built .gem files"
|
65
|
+
task :clear do
|
66
|
+
FileUtils.rm Dir["*.gem"]
|
67
|
+
FileUtils.rm_r Dir["pkg/*"] if File.exist?("pkg")
|
68
|
+
end
|
69
|
+
|
70
|
+
require 'rspec/core/rake_task'
|
71
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
72
|
+
spec.rspec_opts = ['--color', "--format documentation"]
|
73
|
+
end
|
74
|
+
|
75
|
+
task :default => :spec
|
Binary file
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: trinidad_mssql_dbpool_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.4.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Tatnall
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
14
|
-
default_executable:
|
13
|
+
date: 2012-12-03 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: trinidad_dbpool
|
@@ -21,7 +20,7 @@ dependencies:
|
|
21
20
|
requirements:
|
22
21
|
- - ">="
|
23
22
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
23
|
+
version: 0.4.0
|
25
24
|
type: :runtime
|
26
25
|
version_requirements: *id001
|
27
26
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +31,7 @@ dependencies:
|
|
32
31
|
requirements:
|
33
32
|
- - ">="
|
34
33
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
34
|
+
version: "2.10"
|
36
35
|
type: :development
|
37
36
|
version_requirements: *id002
|
38
37
|
- !ruby/object:Gem::Dependency
|
@@ -43,43 +42,10 @@ dependencies:
|
|
43
42
|
requirements:
|
44
43
|
- - ">="
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
version: "0"
|
45
|
+
version: "0.10"
|
47
46
|
type: :development
|
48
47
|
version_requirements: *id003
|
49
|
-
|
50
|
-
name: trinidad_dbpool
|
51
|
-
prerelease: false
|
52
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: "0"
|
58
|
-
type: :runtime
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: rspec
|
62
|
-
prerelease: false
|
63
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.2.9
|
69
|
-
type: :development
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: mocha
|
73
|
-
prerelease: false
|
74
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
|
-
requirements:
|
77
|
-
- - ">="
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: "0"
|
80
|
-
type: :development
|
81
|
-
version_requirements: *id006
|
82
|
-
description: Addon to support Mssql database pools in Trinidad
|
48
|
+
description: Addon to support MS SQL Server database pools in Trinidad
|
83
49
|
email: btatnall@gmail.com
|
84
50
|
executables: []
|
85
51
|
|
@@ -89,14 +55,14 @@ extra_rdoc_files:
|
|
89
55
|
- LICENSE
|
90
56
|
- README.rdoc
|
91
57
|
files:
|
92
|
-
- LICENSE
|
93
|
-
- README.rdoc
|
94
|
-
- VERSION
|
95
58
|
- lib/trinidad_mssql_dbpool_extension.rb
|
96
59
|
- lib/trinidad_mssql_dbpool_extension/mssql_webapp_extension.rb
|
97
|
-
- trinidad-libs/jtds-1.2.
|
98
|
-
|
99
|
-
|
60
|
+
- trinidad-libs/jtds-1.2.7.jar
|
61
|
+
- History.txt
|
62
|
+
- LICENSE
|
63
|
+
- README.rdoc
|
64
|
+
- Rakefile
|
65
|
+
homepage: http://github.com/trinidad/trinidad_dbpool_extension
|
100
66
|
licenses: []
|
101
67
|
|
102
68
|
post_install_message:
|
@@ -119,9 +85,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
85
|
requirements: []
|
120
86
|
|
121
87
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.
|
88
|
+
rubygems_version: 1.8.15
|
123
89
|
signing_key:
|
124
90
|
specification_version: 3
|
125
|
-
summary: Addon to support
|
91
|
+
summary: Addon to support MS SQL Server database pools in Trinidad
|
126
92
|
test_files: []
|
127
93
|
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.3.0
|
Binary file
|