1. Botan
ldd /usr/local/bin/softhsm
ln -s /usr/local/lib/libbotan-1.8.2.so /usr/lib
dpkg-reconfigure tzdata
softhsm --init-token --slot 0 --label "mydnssec"
Phusion_Passenger/3.0.0.pre2 configured -- resuming normal operations [ pid=56614 thr=0x7fff706fcc20 file=ext/apache2/Hooks.cpp:859 time=2010-09-19 22:18:29.96 ]: Unexpected error in mod_passenger: Cannot spawn application '/Users/robertrouse/Sites/myapp': The spawn server has exited unexpectedly. Backtrace: in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750) in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:296) in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:565)
rvm repair all
#!/usr/bin/env ruby
require 'rubygems'
require 'dbi'
db = DBI.connect('dbi:ODBC:dbintegration', 'epres_amir', 'epres_amir8899')
select = db.prepare("select * from information_schema.columns where table_name = 'ref_course' order by ordinal_position")
select.execute
while rec = select.fetch do
puts rec.to_s
end
db.disconnect
["DBIntegration", "dbo", "REF_COURSE", "COURSEID", "1", nil, "No ", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COURSE_CODE", "2", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COURSE_DESCBM", "3", nil, "YES", "varchar", 200, 200, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COURSE_DESCBI", "4", nil, "YES", "varchar", 200, 200, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "CREDIT_HR", "5", nil, "YES", "numeric", nil, nil, true, "10", 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "EXAM_COURSE", "6", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "FACULTYID", "7", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "ACTIVE", "8", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "OWNERID", "9", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "PROJECT_COURSE", "10", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "FINAL_EXAM", "11", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "EXAM_DURATION", "12", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COMMON_COURSE", "13", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COURSETYPE", "14", nil, "YES", "varchar", 15, 15, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COURSE_CATEGORY", "15", nil, "YES", "varchar", 1, 1, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "COMMON_FAC", "16", nil, "YES", "varchar", 10, 10, nil, nil, nil, nil, nil, nil, "iso_1", nil, nil, "SQL_Latin1_General_CP1_CI_AS", nil, nil, nil]
["DBIntegration", "dbo", "REF_COURSE", "DATE_RELOAD", "17", nil, "YES", "datetime", nil, nil, true, nil, 3, "3", nil, nil, nil, nil, nil, nil, nil, nil, nil]
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter=> "mysql",
:host => "localhost",
:username => "sub_integration",
:password => "sub_integration",
:database=> "skt"
)
ActiveRecord::Schema.define do
create_table :subjects do |table|
table.string :COURSEID
table.string :COURSE_CODE
table.string :COURSE_DESCBM
table.string :COURSE_DESCBI
table.integer:CREDIT_HR
table.string :EXAM_COURSE
table.string :FACULTYID
table.string :ACTIVE
table.string :OWNERID
table.string :PROJECT_COURSE
table.string :FINAL_EXAM
table.string :EXAM_DURATION
table.string :COMMON_COURSE
table.string :COURSETYPE
table.string :COURSE_CATEGORY
table.string :COMMON_FAC
table.string :DATE_RELOAD
table.timestamps
end
end
#!/usr/bin/env ruby
require 'rubygems'
require 'dbi'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter=> "mysql",
:host => "localhost",
:username => "sub_integration",
:password => "sub_integration",
:database=> "skt"
)
class Subject < db =" DBI.connect('dbi:ODBC:dbintegration'," select =" db.prepare('SELECT" rec =" select.fetch" subject =" Subject.new("> rec[0],
"COURSE_CODE" => rec[1],
"COURSE_DESCBM" => rec[2],
"COURSE_DESCBI" => rec[3],
"CREDIT_HR" => rec[4],
"EXAM_COURSE" => rec[5],
"FACULTYID" => rec[6],
"ACTIVE" => rec[7],
"OWNERID" => rec[8],
"PROJECT_COURSE" => rec[10],
"FINAL_EXAM" => rec[11],
"EXAM_DURATION" => rec[12],
"COMMON_COURSE" => rec[13],
"COURSETYPE" => rec[14],
"COURSE_CATEGORY" => rec[15],
"COMMON_FAC" => rec[15],
"DATE_RELOAD" => rec[16]
)
subject.save
end
db.disconnect
wget http://www.unixodbc.org/unixODBC-2.3.0.tar.gz2. freedts
tar vxfz unixODBC-2.3.0.tar.gz;cd unixODBC-2.3.0
./configure; make; make install
wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgzDatabase information
tar vxfz freetds-stable.tgz; cd freetds-0.82
./configure --with-unixodbc=/usr/local ; make; make install
Server: 10.0.1.70Configuration File
Database Type: MSSQL 2000
Database Name: dbintegration
Username: epres_amir
Password: epres_amir8899
[dbintegration]2 /usr/local/etc/odbcinst.ini
host = 10.0.10.73
tds version = 7.0
port = 1433
[FreeTDS]3. /usr/local/etc/odbc.ini
Description = FreeTDS unixODBC Driver
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so
UsageCount = 1
[dbintegration]Testing Connection to DB
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Trace = No
Servername = dbintegration
Database = dbintegration
isql -v dbintegration epres_amir epre_amir8899or
TDSVER=7.0 tsql -H 10.0.1.70 -p 1433 -U epres_amir -P epres_amir8899
gem install dbiSample ruby code
gem install dbd-odbc
#!/usr/bin/env rubySample output
require 'rubygems'
require 'dbi'
db = DBI.connect('dbi:ODBC:dbintegration', 'epres_amir', 'epres_amir8899')
select = db.prepare('SELECT TOP 100 * FROM ref_course')
#return schema select * from information_schema.columns where table_name = 'ref_course' order by ordinal_position
select.execute
while rec = select.fetch do
puts rec.to_s
end
db.disconnect
["OAD011", "OAD011", "MENAIP", "KEYBOARDING", #, "Y", nil, "1", "OM", "N", "Y", "60", "160", "KI", nil, "PEP", #]
["MAT225", "MAT225", "KEJURUTERAAN MATEMATIK III", "ENGINEERING MATHEMATICS III", #, "Y", nil, "1", "EM", "N", "Y", "180", "0", "KI", nil, nil, #]
["HRM551", "HRM551", "PENGURUSAN PERUBAHAN", "MANAGEMENT OF CHANGE", #, "Y", nil, "1", "BM", "N", "Y", "180", "160", "KI", nil, "PEP", #]
["ICM358", "ICM358", "INST FOOD SERVICE MGMT", "INST FOOD SERVICE MGMT", #, nil, nil, "0", "HM", "N", "N", nil, nil, "KI", nil, nil, #]
["IDE256-2", "IDE256", "STUDIO PRESENT .II", "STUDIO PRESENT .II", #, nil, nil, "0", "AD", "N", "N", nil, nil, "KI", nil, nil, #]
["IDE256-3", "IDE256", "STUDIO PRESENT.II", "STUDIO PRESENT.II", #, nil, nil, "0", "AD", "N", "N", nil, nil, "KI", nil, nil, #]
["LAW333", "LAW333", "SUPERVISED RESEARCH", "SUPERVISED RESEARCH", #, nil, nil, "0", "AL", "N", "N", nil, nil, "KI", nil, nil, #]
["LAW354", "LAW354", "CIV PROC DRAFTING II", "CIV PROC DRAFTING II", #, nil, nil, "0", "AL", "N", "N", nil, nil, "KI", nil, nil, #]
The first file is the Sqlite command line program used for modifing the Sqlite database. You may or may not use this.
The second file is the Windows DLL library file and Ruby uses this when Rails makes Sqlite database calls.
When both these ZIP files have been extracted you should have the following files: