Trying to connect to Oracle 9i

瀏覽次數:70 次
跳到第一則未讀訊息

Fabio Montarsolo

未讀,
2015年1月22日 清晨7:57:402015/1/22
收件者:oracle-...@googlegroups.com
I use regularly oracle enhanced adapter to connect to oracle 10 and 11 db's.

Now I have the need to connect to an Oracle 9i db...

I have set up the connection but I got the following error:

oracle/jdbc/driver/PhysicalConnection.java:9441:in `setDbTzCalendar': java.lang.
StringIndexOutOfBoundsException: String index out of range: 0
        from oracle/jdbc/driver/PhysicalConnection.java:9303:in `setSessionTimeZ
one'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-oracle_enha
nced-adapter-1.5.4/lib/active_record/connection_adapters/oracle_enhanced_jdbc_co
nnection.rb:144:in `new_connection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-oracle_enha
nced-adapter-1.5.4/lib/active_record/connection_adapters/oracle_enhanced_jdbc_co
nnection.rb:67:in `initialize'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-oracle_enha
nced-adapter-1.5.4/lib/active_record/connection_adapters/oracle_enhanced_connect
ion.rb:11:in `create'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-oracle_enha
nced-adapter-1.5.4/lib/active_record/connection_adapters/oracle_enhanced_adapter
.rb:152:in `oracle_enhanced_connection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connect
ion'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_ne
w_connection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_con
nection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:351:in `checkout'
        from C:/jrails4/jruby/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:265:in `connection'

        from C:/jrails4/jruby/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'

        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_co
nnection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_handling.rb:113:in `retrieve_connection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/connection_handling.rb:87:in `connection'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/model_schema.rb:214:in `columns'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/model_schema.rb:260:in `column_names'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/relation/calculations.rb:221:in `aggregate_column'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/relation/calculations.rb:244:in `execute_simple_calculation'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/relation/calculations.rb:216:in `perform_calculation'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/relation/calculations.rb:111:in `calculate'
        from C:/jrails4/jruby/lib/ruby/gems/shared/gems/activerecord-4.1.0/lib/a
ctive_record/relation/calculations.rb:26:in `count'
        from C:0:in `count'
        from transcont.rb:6:in `(root)'
        from transcont.rb:6:in `(root)'

I tried specifying ENV['TZ'] = 'UTC' in oracle.rb initializers with no luck, same error

If I add the time_zone directive in database.yml the error message changes and says:

oracle/jdbc/driver/T4CTTIoer.java:450:in `processError': java.sql.SQLDataExcepti
on: ORA-01882: impossibile trovare l'area del fuso orario

I tried with time_zone = utc,UTC,Rome,Europe/Rome,local

no luck

any ideas? maybe oracle 9i is not supported at all?

Cynthia Kiser

未讀,
2015年1月22日 下午6:39:052015/1/22
收件者:oracle-...@googlegroups.com
Just to make sure, you can connect to the 9i database with the version of the Oracle Instant Client the oracle-enhanced driver is compiled against? For example using SQLPlus? I know there were some backwards compatibility issues to connect to Oracle 8i databases but I don't know for sure about 9i.

--
You received this message because you are subscribed to the Google Groups "Oracle enhanced adapter for ActiveRecord" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oracle-enhanc...@googlegroups.com.
To post to this group, send email to oracle-...@googlegroups.com.
Visit this group at http://groups.google.com/group/oracle-enhanced.
For more options, visit https://groups.google.com/d/optout.



--
Cynthia Kiser
cynthi...@gmail.com

Fabio Montarsolo

未讀,
2015年1月23日 清晨6:26:032015/1/23
收件者:oracle-...@googlegroups.com
With sql plus I connect to the oracle 9i db without any issue, from the same virtual machine rails is installed.

I made a workaround by using a db link from the oracle db on the rails machine connecting to the oracle 9i on the other machine and connecting rails to the local db.

But if possible I would like to connect directly...

Kubo Takehiro

未讀,
2015年1月23日 下午6:14:282015/1/23
收件者:oracle-...@googlegroups.com
Look at Note 207303.1 "Client / Server / Interoperability Support Between Different Oracle Versions" at Oracle support.
You need Oracle support ID to see it.

It was translated to Japanese by Oracle Japan. You can see the translated version without Oracle support ID.

Kubo Takehiro

未讀,
2015年1月23日 晚上9:19:132015/1/23
收件者:oracle-...@googlegroups.com
On Fri, Jan 23, 2015 at 8:26 PM, Fabio Montarsolo <fabio.mo...@gmail.com> wrote:
> With sql plus I connect to the oracle 9i db without any issue, from the same virtual machine rails is installed.

If you use JDBC thin driver, try JDBC OCI driver.
sqlplus uses OCI libraries written in C. JDBC OCI driver also uses same libraries.
http://docs.oracle.com/cd/B28359_01/java.111/b31224/overvw.htm

Use "url: jdbc:oracle:oci:@<host>:<port>:<database>" in database.yml instead of "database: ...", "host: ..." and "port: ...".
Oracle enhanced driver uses thin driver by default.

Fabio Montarsolo

未讀,
2015年1月26日 上午9:18:252015/1/26
收件者:oracle-...@googlegroups.com
I'm using jruby, I don't think I can usi OCI libraries... 

Kubo Takehiro

未讀,
2015年1月26日 上午10:04:042015/1/26
收件者:oracle-...@googlegroups.com
I know that you are using jruby.
JDBC OCI dirver is a JDBC driver. Jruby can use it because It is a driver for Java.
See http://docs.oracle.com/cd/B28359_01/java.111/b31224/overvw.htm#sthref26

Well, though jruby can use it, I don't know whether oracle_enhanced is tested with JDBC OCI driver.
IMO, it will work if oracle_enhanced doesn't use JDBC thin driver specific features.

Kubo Takehiro

未讀,
2015年1月26日 上午10:18:352015/1/26
收件者:oracle-...@googlegroups.com
On Tue, Jan 27, 2015 at 12:04 AM, Kubo Takehiro <kubo.t...@gmail.com> wrote:
On Mon, Jan 26, 2015 at 11:18 PM, Fabio Montarsolo <fabio.mo...@gmail.com> wrote:
Il giorno sabato 24 gennaio 2015 03:19:13 UTC+1, KUBO Takehiro ha scritto:
On Fri, Jan 23, 2015 at 8:26 PM, Fabio Montarsolo <fabio.mo...@gmail.com> wrote:
> With sql plus I connect to the oracle 9i db without any issue, from the same virtual machine rails is installed.

If you use JDBC thin driver, try JDBC OCI driver.
sqlplus uses OCI libraries written in C. JDBC OCI driver also uses same libraries.
http://docs.oracle.com/cd/B28359_01/java.111/b31224/overvw.htm

Use "url: jdbc:oracle:oci:@<host>:<port>:<database>" in database.yml instead of "database: ...", "host: ..." and "port: ...".
Oracle enhanced driver uses thin driver by default.

I'm using jruby, I don't think I can usi OCI libraries... 

I know that you are using jruby.
JDBC OCI dirver is a JDBC driver. Jruby can use it because It is a driver for Java.
See http://docs.oracle.com/cd/B28359_01/java.111/b31224/overvw.htm#sthref26

Fabio Montarsolo

未讀,
2015年1月30日 上午8:39:482015/1/30
收件者:oracle-...@googlegroups.com
Tried with oci, no go...

Kubo Takehiro

未讀,
2015年1月30日 上午10:02:242015/1/30
收件者:oracle-...@googlegroups.com
On Fri, Jan 30, 2015 at 10:39 PM, Fabio Montarsolo <fabio.mo...@gmail.com> wrote:

Tried with oci, no go...

Then, could you try Oracle client 10.1.0.5?

Client 10.1.0 - Server 9.2.0 was supported except EBCDIC problems.
Client 10.1.0 - Server 10.1.0 and Server 10.2.0 was supported.
Client 10.1.0 - Server 11.1.0 and 11.2.0 was supported though the client version must be 10.1.0.5 to use PL/SQL.

https://translate.google.com/translate?sl=ja&tl=en&js=y&ie=UTF-8&u=http%3A%2F%2Fwww.oracle.com%2Fjp%2Fsystem-requirement%2Finteroperability-support-195844-ja.html

Fabio Montarsolo

未讀,
2015年1月30日 上午10:56:262015/1/30
收件者:oracle-...@googlegroups.com
Ok, I solved by updatating ojdb6.jar to the latest version. Thank you all.

Fabio
回覆所有人
回覆作者
轉寄
0 則新訊息