jfb 0.1.3 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jfb.gemspec +0 -1
- data/lib/jfb/jaybird-2.2.10.jar +0 -0
- data/lib/jfb/jfb.rb +22 -11
- data/lib/jfb/version.rb +7 -1
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddffa666ab2bb112b134de99e1c54cabdb8b9e75
|
4
|
+
data.tar.gz: 60f9f399ec5857e4715c96108ce0e95ee2a3e323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6804aab158b603e0047d0da61a641750ba0b7caa9b6bc6a9870f3e62956f30763a2d15bffe012f13ee53e859bcebf6aec6034557f4de201c41c1213be6faff05
|
7
|
+
data.tar.gz: 6eb7afff495bc169c26a2193d34ee55719ffda6fba02fdc473a9d922cc5bd43351006d82f1ed83a915a892e03689099cd82e5972c688f28a7c1e7c56e924451a
|
data/jfb.gemspec
CHANGED
Binary file
|
data/lib/jfb/jfb.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require_relative 'rs'
|
2
|
-
require '
|
3
|
-
java_import 'java.sql.DriverManager'
|
2
|
+
require './jaybird-2.2.10.jar'
|
4
3
|
java_import 'java.sql.ResultSet'
|
5
4
|
java_import 'java.sql.SQLRecoverableException'
|
6
5
|
|
@@ -9,21 +8,33 @@ class JFB
|
|
9
8
|
@closed = true
|
10
9
|
|
11
10
|
def initialize(db_url, usr, pwd)
|
12
|
-
|
13
|
-
|
14
|
-
@con = DriverManager.getConnection("jdbc:firebirdsql:" + db_url, usr, pwd)
|
11
|
+
Java::JavaClass.for_name("org.firebirdsql.jdbc.FBDriver")
|
12
|
+
fbd = org.firebirdsql.jdbc.FBDriver
|
15
13
|
|
16
|
-
|
14
|
+
if fbd.acceptsURL("jdbc:firebirdsql:#{db_url}") then
|
15
|
+
Java::JavaClass.for_name("java.util.Properties")
|
16
|
+
|
17
|
+
props = java.util.Properties.new
|
18
|
+
props.set_property :user, usr
|
19
|
+
props.set_property :password, pwd
|
20
|
+
|
21
|
+
begin
|
22
|
+
@con = fbd.connect("jdbc:firebirdsql:#{db_url}", props)
|
23
|
+
@con.setAutocommit false
|
17
24
|
@con.setHoldability ResultSet.HOLD_CURSORS_OVER_COMMIT
|
18
25
|
@closed = false
|
19
|
-
else
|
20
|
-
puts "Failure to load driver."
|
21
|
-
end
|
22
26
|
|
23
|
-
|
27
|
+
rescue SQLRecoverableException => erro
|
28
|
+
@con = nil
|
29
|
+
@closed = true
|
30
|
+
puts "Error connecting!\n#{erro}"
|
31
|
+
end
|
32
|
+
else
|
24
33
|
@con = nil
|
25
34
|
@closed = true
|
26
|
-
puts "
|
35
|
+
puts "Database URI #{db_url} isn't acceptable.
|
36
|
+
You don't have to supply the 'jdbc:firebirsql:' part,
|
37
|
+
we already do that. Please check your URI."
|
27
38
|
end
|
28
39
|
end
|
29
40
|
|
data/lib/jfb/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Jfb
|
2
|
-
VERSION = "0.
|
2
|
+
VERSION = "0.2.3"
|
3
3
|
|
4
4
|
#Version 0.1.0
|
5
5
|
# Creates proper interface with jdbc
|
@@ -14,4 +14,10 @@ module Jfb
|
|
14
14
|
|
15
15
|
#Version 0.1.3
|
16
16
|
# Adds ResultSet class import for jfb
|
17
|
+
|
18
|
+
#Version 0.2.3
|
19
|
+
# Removes jdbc/firebird dependency
|
20
|
+
# Adds jaybird version 2.2.10 to gem
|
21
|
+
# Makes connection idependent from standard java.sql, as to prevent 'no suitable driver' related errors
|
22
|
+
# Better handling and detection plausible connections
|
17
23
|
end
|
metadata
CHANGED
@@ -1,73 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jfb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rCamposCruz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '1.13'
|
20
|
-
|
19
|
+
name: bundler
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '10.0'
|
34
|
-
|
33
|
+
name: rake
|
35
34
|
prerelease: false
|
35
|
+
type: :development
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '3.0'
|
48
|
-
|
47
|
+
name: rspec
|
49
48
|
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: jdbc/firebird
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '2.2'
|
62
49
|
type: :development
|
63
|
-
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
description: A very simple gem which interfaces JDBC's connections and ResultSet,
|
70
|
-
making easier for simple usage of it's resources.
|
54
|
+
version: '3.0'
|
55
|
+
description: A very simple gem which interfaces JDBC's connections and ResultSet, making easier for simple usage of it's resources.
|
71
56
|
email:
|
72
57
|
- rafaelcpcruz@hotmail.com
|
73
58
|
executables: []
|
@@ -87,6 +72,7 @@ files:
|
|
87
72
|
- bin/setup
|
88
73
|
- jfb.gemspec
|
89
74
|
- lib/jfb.rb
|
75
|
+
- lib/jfb/jaybird-2.2.10.jar
|
90
76
|
- lib/jfb/jfb.rb
|
91
77
|
- lib/jfb/rs.rb
|
92
78
|
- lib/jfb/version.rb
|
@@ -94,7 +80,7 @@ homepage: https://github.com/rCamposCruz/jfb
|
|
94
80
|
licenses:
|
95
81
|
- MIT
|
96
82
|
metadata: {}
|
97
|
-
post_install_message:
|
83
|
+
post_install_message:
|
98
84
|
rdoc_options: []
|
99
85
|
require_paths:
|
100
86
|
- lib
|
@@ -109,9 +95,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
requirements: []
|
112
|
-
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
114
|
-
signing_key:
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 2.6.8
|
100
|
+
signing_key:
|
115
101
|
specification_version: 4
|
116
102
|
summary: Gem which interfaces ruby and JDBC.
|
117
103
|
test_files: []
|