Class: Java::java.sql::DriverManager

Inherits:
Object
  • Object
show all
Defined in:
lib/torquebox/vfs/ext/jdbc.rb

Overview

Copyright 2008-2011 Red Hat, Inc, and individual contributors.

This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: www.fsf.org.

Class Method Summary collapse

Class Method Details

.get_connection_without_vfsObject



20
# File 'lib/torquebox/vfs/ext/jdbc.rb', line 20

alias_method :get_connection_without_vfs, :getConnection

.getConnection(url, *params) ⇒ Object

Monkey patch getConnection so we can sort out local filesystem url’s for SQLite (we need to remove the ‘vfs:’ from the url). This works for activerecord-jdbc-adapter v1.1.2 and under. For v1.1.3 and up, see web/web-core/src/main/java/org/torquebox/rails/core/boot.rb

Raises:

  • (NotImplementedError)


27
28
29
30
31
32
33
34
35
# File 'lib/torquebox/vfs/ext/jdbc.rb', line 27

def getConnection(url, *params)

  # Remove any VFS prefix from the url (for SQLite)
  url = url.sub(':vfs:', ':')

  # Call the correct version based on the number of arguments
  raise NotImplementedError.new('Need to hande the single param version of getConnection') if params.count == 0
  params.count == 1 ? get_connection_with_properties(url, params.first) : get_connection_with_username_password(url, params[0], params[1])
end

.register_driver_without_vfsObject



21
# File 'lib/torquebox/vfs/ext/jdbc.rb', line 21

alias_method :register_driver_without_vfs, :registerDriver

.registerDriver(driver) ⇒ Object



37
38
39
40
# File 'lib/torquebox/vfs/ext/jdbc.rb', line 37

def registerDriver(driver)
  # Should this call the aliased method ??
  @driver = driver
end