Sha256: 0ce4ed6ac416c8316947d16e77058c6f291a250b984718a7b32cd55bf2fb9a8f

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'rubygems'
require 'data_objects'
if RUBY_PLATFORM =~ /java/
  require 'do_jdbc'
  require 'java'
  gem 'jdbc-mysql'
  require 'jdbc/mysql' # the JDBC driver, packaged as a gem
end

require File.expand_path(File.join(File.dirname(__FILE__), 'do_mysql_ext'))
require File.expand_path(File.join(File.dirname(__FILE__), 'do_mysql', 'version'))
require File.expand_path(File.join(File.dirname(__FILE__), 'do_mysql', 'transaction'))

if RUBY_PLATFORM =~ /java/
  # Another way of loading the JDBC Class. This seems to be more reliable
  # than Class.forName() within the data_objects.Connection Java class,
  # which is currently not working as expected.
  import 'com.mysql.jdbc.Driver'

  module DataObjects
    module Mysql
      class Connection
        def self.pool_size
          20
        end

        def using_socket?
          @using_socket
        end
        
        def character_set
          # JDBC API does not provide an easy way to get the current character set
          # For now, we code the character_set used as utf8
          "utf8"
        end

      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
do_mysql-0.9.10 lib/do_mysql.rb
do_mysql-0.9.10.1 lib/do_mysql.rb