Class: JDBC::Adapters::Derby

Inherits:
Object
  • Object
show all
Defined in:
lib/jdbc/adapters/derby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, user, password, schema) ⇒ Derby

Returns a new instance of Derby.



6
7
8
9
10
11
12
# File 'lib/jdbc/adapters/derby.rb', line 6

def initialize(host, port, user, password, schema)
  @host = host
  @port = port
  @user = user
  @password = password
  @schema = schema
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



4
5
6
# File 'lib/jdbc/adapters/derby.rb', line 4

def host
  @host
end

#passwordObject (readonly)

Returns the value of attribute password.



4
5
6
# File 'lib/jdbc/adapters/derby.rb', line 4

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



4
5
6
# File 'lib/jdbc/adapters/derby.rb', line 4

def port
  @port
end

#schemaObject (readonly)

Returns the value of attribute schema.



4
5
6
# File 'lib/jdbc/adapters/derby.rb', line 4

def schema
  @schema
end

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/jdbc/adapters/derby.rb', line 4

def user
  @user
end

Instance Method Details

#class_nameObject



24
25
26
# File 'lib/jdbc/adapters/derby.rb', line 24

def class_name
  "org.apache.derby.jdbc.EmbeddedDriver"
end

#connection_stringObject



14
15
16
17
18
19
20
21
22
# File 'lib/jdbc/adapters/derby.rb', line 14

def connection_string
  str = "jdbc:derby:#{@schema}"

  if ! File.exist?(@schema)
    str << ";create=true"
  end

  return str
end