jfb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jfb.gemspec +1 -0
- data/lib/jfb/jfb.rb +7 -6
- data/lib/jfb/version.rb +5 -1
- metadata +32 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5d565f9c97e603fd5a4c07419e483eb8347f7a
|
4
|
+
data.tar.gz: 1a5b295e418c282b85cf461cfdccd4f9bbc33954
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6966dde52ead171ea29dacc0c6e470bca2b99cec8d688ca71864f2802631048ac096097698cad51affcc190a452aafd725259bcb9f5dc65ae68a30d334560b65
|
7
|
+
data.tar.gz: fd5dc9a94fd3dc1e22e00ae427afbf3bd70c99586e890bad3463792a30727796e133108ec32ac382fcd4e61cd11d86072266cac733e5356acf775887d539b3d8
|
data/jfb.gemspec
CHANGED
data/lib/jfb/jfb.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require_relative 'rs'
|
2
2
|
require 'jdbc/firebird'
|
3
|
+
java_import 'java.sql.DriverManager'
|
4
|
+
java_import 'java.sql.SQLRecoverableException'
|
3
5
|
|
4
6
|
class JFB
|
5
7
|
@con = nil
|
@@ -8,17 +10,16 @@ class JFB
|
|
8
10
|
def initialize(db_url, usr, pwd)
|
9
11
|
begin
|
10
12
|
if Jdbc::Firebird.load_driver then
|
11
|
-
@con =
|
12
|
-
puts 3
|
13
|
+
@con = DriverManager.getConnection(db_url, usr, pwd)
|
13
14
|
|
14
15
|
@con.setAutoCommit false
|
15
|
-
@con.setHoldability
|
16
|
+
@con.setHoldability ResultSet.HOLD_CURSORS_OVER_COMMIT
|
16
17
|
@closed = false
|
17
18
|
else
|
18
19
|
puts "Failure to load driver."
|
19
20
|
end
|
20
21
|
|
21
|
-
rescue
|
22
|
+
rescue SQLRecoverableException => erro
|
22
23
|
@con = nil
|
23
24
|
@closed = true
|
24
25
|
puts "Error connecting!\n#{erro}"
|
@@ -29,7 +30,7 @@ class JFB
|
|
29
30
|
if not @closed then
|
30
31
|
begin
|
31
32
|
return RS.new(@con.createStatement().executeQuery(cmd))
|
32
|
-
rescue
|
33
|
+
rescue Error => erro
|
33
34
|
puts "Error message:\n#{erro}"
|
34
35
|
end
|
35
36
|
end
|
@@ -41,7 +42,7 @@ class JFB
|
|
41
42
|
if not @closed then
|
42
43
|
begin
|
43
44
|
@con.createStatement().executeUpdate(cmd)
|
44
|
-
rescue
|
45
|
+
rescue Error => erro
|
45
46
|
puts "Error message:\n#{erro}"
|
46
47
|
end
|
47
48
|
else
|
data/lib/jfb/version.rb
CHANGED
metadata
CHANGED
@@ -1,58 +1,73 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jfb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
|
-
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.13'
|
20
|
-
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
23
|
requirements:
|
22
24
|
- - "~>"
|
23
25
|
- !ruby/object:Gem::Version
|
24
26
|
version: '1.13'
|
25
|
-
prerelease: false
|
26
|
-
type: :development
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
|
-
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
37
|
requirements:
|
36
38
|
- - "~>"
|
37
39
|
- !ruby/object:Gem::Version
|
38
40
|
version: '10.0'
|
39
|
-
prerelease: false
|
40
|
-
type: :development
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
43
50
|
version_requirements: !ruby/object:Gem::Requirement
|
44
51
|
requirements:
|
45
52
|
- - "~>"
|
46
53
|
- !ruby/object:Gem::Version
|
47
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jdbc/firebird
|
48
57
|
requirement: !ruby/object:Gem::Requirement
|
49
58
|
requirements:
|
50
59
|
- - "~>"
|
51
60
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
53
|
-
prerelease: false
|
61
|
+
version: '2.2'
|
54
62
|
type: :development
|
55
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.2'
|
69
|
+
description: A very simple gem which interfaces JDBC's connections and ResultSet,
|
70
|
+
making easier for simple usage of it's resources.
|
56
71
|
email:
|
57
72
|
- rafaelcpcruz@hotmail.com
|
58
73
|
executables: []
|
@@ -80,7 +95,7 @@ homepage: https://github.com/rCamposCruz/jfb
|
|
80
95
|
licenses:
|
81
96
|
- MIT
|
82
97
|
metadata: {}
|
83
|
-
post_install_message:
|
98
|
+
post_install_message:
|
84
99
|
rdoc_options: []
|
85
100
|
require_paths:
|
86
101
|
- lib
|
@@ -95,9 +110,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
110
|
- !ruby/object:Gem::Version
|
96
111
|
version: '0'
|
97
112
|
requirements: []
|
98
|
-
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
100
|
-
signing_key:
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.5.1
|
115
|
+
signing_key:
|
101
116
|
specification_version: 4
|
102
117
|
summary: Gem which interfaces ruby and JDBC.
|
103
118
|
test_files: []
|