ODBCCLIUnixInterface - ODBC support on Unix/Linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ODBCCLIUnixInterface - ODBC support on Unix/Linux

Simon Yates
I am currently trying to get an Oracle Linux ODBC driver to work with
vw7.4.1, but I can not find a nix platform implementation for the ODBC
CLI. Trawling around the archive I can see someone else has also
traveled this path, below in these threads:

http://www.parcplace.net/list/vwnc-archive/0501/msg00328.html
http://www.parcplace.net/list/vwnc-archive/0501/msg00337.html

Has ODBCCLIUnixInterface been incorporated, or is there somewhere else I
should be looking for Unix/Linux ODBC CLI implementation, or should I
look to use the suggestion in the thread.

Any info would be great.

Simon

Reply | Threaded
Open this post in threaded view
|

Re: ODBCCLIUnixInterface - ODBC support on Unix/Linux

Milan Čermák
Hi Simon,

some time ago I needed to use MySQL on Linux, so I wrote ODBC interface
myself for VW 7.0. Attached, I send the parcel with my implementation.
(It's quite simple.)

Enjoy,
Milan Čermák

Simon Yates napsal(a):

> I am currently trying to get an Oracle Linux ODBC driver to work with
> vw7.4.1, but I can not find a nix platform implementation for the ODBC
> CLI. Trawling around the archive I can see someone else has also
> traveled this path, below in these threads:
>
> http://www.parcplace.net/list/vwnc-archive/0501/msg00328.html
> http://www.parcplace.net/list/vwnc-archive/0501/msg00337.html
>
> Has ODBCCLIUnixInterface been incorporated, or is there somewhere else I
> should be looking for Unix/Linux ODBC CLI implementation, or should I
> look to use the suggestion in the thread.
>
> Any info would be great.
>
> Simon
--
Ing. Milan Čermák
programátor, analytik

[hidden email]

................................................................
e-FRACTAL, s.r.o. => e-business driven company
Vinohradská 174, Praha 3, http://www.e-fractal.cz
tel: 222 523 000, fax: 222 524 060
................................................................

<?xml version="1.0"?>

<st-source>
<!--
Name: ODBC Unix support
DbIdentifier: nil
DbTrace: nil
DevelopmentPrerequisites: #(#(#any 'ODBCEXDI' ''))
PackageName: ODBC Unix support
Parcel: #('ODBC Unix support')
ParcelName: ODBC Unix support
PrintStringCache: nil
Date: 8:46:14 am January 31, 2005
 -->
<time-stamp>From VisualWorks®, 7.3 of 3. prosinec 2004 on 31. leden 2005 at 8:46:14</time-stamp>


<do-it>(Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned.  Choose terminate or close.']</do-it>

<class>
<name>ODBCCLIUnixInterface</name>
<environment>Database</environment>
<super>Database.ODBCCLIInterface</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports>
                        private Database.ODBCCLIUnixInterfaceDictionary.*
                        </imports>
<category>Database-External-Libraries</category>
<attributes>
<includeFiles></includeFiles>
<includeDirectories></includeDirectories>
<libraryFiles><item>libodbc.so.1</item></libraryFiles>
<libraryDirectories></libraryDirectories>
<beVirtual>false</beVirtual>
<optimizationLevel>full</optimizationLevel>
<package>ODBC Unix support</package>
</attributes>
</class>

<methods>
<class-id>Database.ODBCCLIUnixInterface class</class-id> <category>class initialization</category>

<body package="ODBC Unix support" selector="initialize">initialize

        super initialize</body>
</methods>

<methods>
<class-id>Database.ODBCConnection class</class-id> <category>class initialization</category>

<body package="ODBC Unix support" selector="initializeExternalInterface">initializeExternalInterface
        "Reset xif call with the right interface class based on the current platform."

        "Modified by Milan Cermak &lt;[hidden email]&gt; March 15, 2003"
        "Due to lazy initialization of xif variable calling self xif will cause unfinite loop.
         This happens on platforms without ODBC support."

        | xifClass |
        xifClass := self interfaceClass.
        self xif: (xifClass notNil
                        ifTrue: [xifClass new]
                        ifFalse:
                                "[nil]).
        (self xif isNil ifTrue: "
                                [^Dialog warn: 'The ODBC CLI Driver is not correctly installed.' withCRs]).
        self initializeInformationTypeConversionMap.</body>

<body package="ODBC Unix support" selector="initializeInterfaceMapping">initializeInterfaceMapping

        xifMap := IdentityDictionary new.
        xifMap at: #nt put: #ODBCCLINTInterface.
        xifMap at: #win95 put: #ODBCCLINTInterface.
        xifMap at: #unix put: #ODBCCLIUnixInterface. "for VW 7.0"
        xifMap at: #linux_i386_unix put: #ODBCCLIUnixInterface. "for VW 7.3"
        xifMap at: #unknown put: #ODBCCLIInterface</body>
</methods>

<methods>
<class-id>Database.ODBCConnection class</class-id> <category>private-activation</category>

<body package="ODBC Unix support" selector="install">install
        "Modified by Milan Cermak at April 11, 2003."

        ( TraceLevel &gt;= 1 ) ifTrue:
                [ self trace: nil ].
        Henv := nil.
        HenvReferencesCount := 0.
        self xif: nil.
        self sessionClass install.
        self returnFromSnapshot.
       
        "Reinstall all subclasses. (They need to nil the xif variable.)"
        self subclasses do: [ :each | each install ]</body>
</methods>

<initialize>
<class-id>Database.ODBCCLIUnixInterface</class-id>
</initialize>

<do-it>"Imported Classes:"</do-it>

<do-it>self error: 'Attempting to file-in parcel imports.  Choose terminate or close'</do-it>

<class>
<name>ODBCCLIInterface</name>
<environment>Database</environment>
<super>External.ExternalInterface</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>encoding </inst-vars>
<class-inst-vars>getSelectorMap fSqlTypeToConversionMap fetchBufferSizeBlocks putSelectorMap fCTypeFromConversionMap fSqlTypeFromConversionMap valueSizeBlocks valuePrecisionBlocks dataChunkSize </class-inst-vars>
<imports>
                        private Database.ODBCCLIInterfaceDictionary.*
                        </imports>
<category>Database-External-Libraries</category>
<attributes>
<includeFiles></includeFiles>
<includeDirectories></includeDirectories>
<libraryFiles></libraryFiles>
<libraryDirectories></libraryDirectories>
<beVirtual>true</beVirtual>
<optimizationLevel>full</optimizationLevel>
<package>ODBCEXDI</package>
</attributes>
</class>

</st-source>

ODBC Unix support.pcl (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ODBCCLIUnixInterface - ODBC support on Unix/Linux

Thomas Gagné-2
In reply to this post by Simon Yates
There's a unixODBC package that seems to work well.  I've used it to
interface with both MySQL and SQLServer (too bad Sybase doesn't keep
supporting dblib).

--
Visit <http://tggagne.blogspot.com/>,<http://gagne.homedns.org/> or
      <http://gagne.homedns.org/~tgagne/> for more great reading.

Reply | Threaded
Open this post in threaded view
|

Re: ODBCCLIUnixInterface - ODBC support on Unix/Linux

Simon Yates
In reply to this post by Milan Čermák
Great thanks Milan

I thought ODBCCLIUnixInterface may have found itself into a package over time that I had not found. Thanks everyone for their info.

Simon

Milan Čermák wrote:
Hi Simon,

some time ago I needed to use MySQL on Linux, so I wrote ODBC interface
myself for VW 7.0. Attached, I send the parcel with my implementation.
(It's quite simple.)

Enjoy,
Milan Čermák

Simon Yates napsal(a):
  
I am currently trying to get an Oracle Linux ODBC driver to work with
vw7.4.1, but I can not find a nix platform implementation for the ODBC
CLI. Trawling around the archive I can see someone else has also
traveled this path, below in these threads:

http://www.parcplace.net/list/vwnc-archive/0501/msg00328.html
http://www.parcplace.net/list/vwnc-archive/0501/msg00337.html

Has ODBCCLIUnixInterface been incorporated, or is there somewhere else I
should be looking for Unix/Linux ODBC CLI implementation, or should I
look to use the suggestion in the thread.

Any info would be great.

Simon
    

  

<?xml version="1.0"?> <st-source> <!-- Name: ODBC Unix support DbIdentifier: nil DbTrace: nil DevelopmentPrerequisites: #(#(#any 'ODBCEXDI' '')) PackageName: ODBC Unix support Parcel: #('ODBC Unix support') ParcelName: ODBC Unix support PrintStringCache: nil Date: 8:46:14 am January 31, 2005 --> <time-stamp>From VisualWorksÂŽ, 7.3 of 3. prosinec 2004 on 31. leden 2005 at 8:46:14</time-stamp> <do-it>(Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.']</do-it> <class> <name>ODBCCLIUnixInterface</name> <environment>Database</environment> <super>Database.ODBCCLIInterface</super> <private>false</private> <indexed-type>none</indexed-type> <inst-vars></inst-vars> <class-inst-vars></class-inst-vars> <imports> private Database.ODBCCLIUnixInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libodbc.so.1</item></libraryFiles> <libraryDirectories></libraryDirectories> <beVirtual>false</beVirtual> <optimizationLevel>full</optimizationLevel> <package>ODBC Unix support</package> </attributes> </class> <methods> <class-id>Database.ODBCCLIUnixInterface class</class-id> <category>class initialization</category> <body package="ODBC Unix support" selector="initialize">initialize super initialize</body> </methods> <methods> <class-id>Database.ODBCConnection class</class-id> <category>class initialization</category> <body package="ODBC Unix support" selector="initializeExternalInterface">initializeExternalInterface "Reset xif call with the right interface class based on the current platform." "Modified by Milan Cermak &lt;[hidden email]&gt; March 15, 2003" "Due to lazy initialization of xif variable calling self xif will cause unfinite loop. This happens on platforms without ODBC support." | xifClass | xifClass := self interfaceClass. self xif: (xifClass notNil ifTrue: [xifClass new] ifFalse: "[nil]). (self xif isNil ifTrue: " [^Dialog warn: 'The ODBC CLI Driver is not correctly installed.' withCRs]). self initializeInformationTypeConversionMap.</body> <body package="ODBC Unix support" selector="initializeInterfaceMapping">initializeInterfaceMapping xifMap := IdentityDictionary new. xifMap at: #nt put: #ODBCCLINTInterface. xifMap at: #win95 put: #ODBCCLINTInterface. xifMap at: #unix put: #ODBCCLIUnixInterface. "for VW 7.0" xifMap at: #linux_i386_unix put: #ODBCCLIUnixInterface. "for VW 7.3" xifMap at: #unknown put: #ODBCCLIInterface</body> </methods> <methods> <class-id>Database.ODBCConnection class</class-id> <category>private-activation</category> <body package="ODBC Unix support" selector="install">install "Modified by Milan Cermak at April 11, 2003." ( TraceLevel &gt;= 1 ) ifTrue: [ self trace: nil ]. Henv := nil. HenvReferencesCount := 0. self xif: nil. self sessionClass install. self returnFromSnapshot. "Reinstall all subclasses. (They need to nil the xif variable.)" self subclasses do: [ :each | each install ]</body> </methods> <initialize> <class-id>Database.ODBCCLIUnixInterface</class-id> </initialize> <do-it>"Imported Classes:"</do-it> <do-it>self error: 'Attempting to file-in parcel imports. Choose terminate or close'</do-it> <class> <name>ODBCCLIInterface</name> <environment>Database</environment> <super>External.ExternalInterface</super> <private>false</private> <indexed-type>none</indexed-type> <inst-vars>encoding </inst-vars> <class-inst-vars>getSelectorMap fSqlTypeToConversionMap fetchBufferSizeBlocks putSelectorMap fCTypeFromConversionMap fSqlTypeFromConversionMap valueSizeBlocks valuePrecisionBlocks dataChunkSize </class-inst-vars> <imports> private Database.ODBCCLIInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles></libraryFiles> <libraryDirectories></libraryDirectories> <beVirtual>true</beVirtual> <optimizationLevel>full</optimizationLevel> <package>ODBCEXDI</package> </attributes> </class> </st-source>
Reply | Threaded
Open this post in threaded view
|

ODBCCLIUnixInterface - ODBC support on Unix/Linux -> Working with oracle 10g

Simon Yates
Thanks again Milan

Have Linux ODBC working with Oracle 10g.

Simon

Simon Yates wrote:
Great thanks Milan

I thought ODBCCLIUnixInterface may have found itself into a package over time that I had not found. Thanks everyone for their info.

Simon

Milan Čermák wrote:
Hi Simon,

some time ago I needed to use MySQL on Linux, so I wrote ODBC interface
myself for VW 7.0. Attached, I send the parcel with my implementation.
(It's quite simple.)

Enjoy,
Milan Čermák

Simon Yates napsal(a):
  
I am currently trying to get an Oracle Linux ODBC driver to work with
vw7.4.1, but I can not find a nix platform implementation for the ODBC
CLI. Trawling around the archive I can see someone else has also
traveled this path, below in these threads:

http://www.parcplace.net/list/vwnc-archive/0501/msg00328.html
http://www.parcplace.net/list/vwnc-archive/0501/msg00337.html

Has ODBCCLIUnixInterface been incorporated, or is there somewhere else I
should be looking for Unix/Linux ODBC CLI implementation, or should I
look to use the suggestion in the thread.

Any info would be great.

Simon
    

  

<?xml version="1.0"?> <st-source> <!-- Name: ODBC Unix support DbIdentifier: nil DbTrace: nil DevelopmentPrerequisites: #(#(#any 'ODBCEXDI' '')) PackageName: ODBC Unix support Parcel: #('ODBC Unix support') ParcelName: ODBC Unix support PrintStringCache: nil Date: 8:46:14 am January 31, 2005 --> <time-stamp>From VisualWorksÂŽ, 7.3 of 3. prosinec 2004 on 31. leden 2005 at 8:46:14</time-stamp> <do-it>(Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.']</do-it> <class> <name>ODBCCLIUnixInterface</name> <environment>Database</environment> <super>Database.ODBCCLIInterface</super> <private>false</private> <indexed-type>none</indexed-type> <inst-vars></inst-vars> <class-inst-vars></class-inst-vars> <imports> private Database.ODBCCLIUnixInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libodbc.so.1</item></libraryFiles> <libraryDirectories></libraryDirectories> <beVirtual>false</beVirtual> <optimizationLevel>full</optimizationLevel> <package>ODBC Unix support</package> </attributes> </class> <methods> <class-id>Database.ODBCCLIUnixInterface class</class-id> <category>class initialization</category> <body package="ODBC Unix support" selector="initialize">initialize super initialize</body> </methods> <methods> <class-id>Database.ODBCConnection class</class-id> <category>class initialization</category> <body package="ODBC Unix support" selector="initializeExternalInterface">initializeExternalInterface "Reset xif call with the right interface class based on the current platform." "Modified by Milan Cermak &lt;[hidden email]&gt; March 15, 2003" "Due to lazy initialization of xif variable calling self xif will cause unfinite loop. This happens on platforms without ODBC support." | xifClass | xifClass := self interfaceClass. self xif: (xifClass notNil ifTrue: [xifClass new] ifFalse: "[nil]). (self xif isNil ifTrue: " [^Dialog warn: 'The ODBC CLI Driver is not correctly installed.' withCRs]). self initializeInformationTypeConversionMap.</body> <body package="ODBC Unix support" selector="initializeInterfaceMapping">initializeInterfaceMapping xifMap := IdentityDictionary new. xifMap at: #nt put: #ODBCCLINTInterface. xifMap at: #win95 put: #ODBCCLINTInterface. xifMap at: #unix put: #ODBCCLIUnixInterface. "for VW 7.0" xifMap at: #linux_i386_unix put: #ODBCCLIUnixInterface. "for VW 7.3" xifMap at: #unknown put: #ODBCCLIInterface</body> </methods> <methods> <class-id>Database.ODBCConnection class</class-id> <category>private-activation</category> <body package="ODBC Unix support" selector="install">install "Modified by Milan Cermak at April 11, 2003." ( TraceLevel &gt;= 1 ) ifTrue: [ self trace: nil ]. Henv := nil. HenvReferencesCount := 0. self xif: nil. self sessionClass install. self returnFromSnapshot. "Reinstall all subclasses. (They need to nil the xif variable.)" self subclasses do: [ :each | each install ]</body> </methods> <initialize> <class-id>Database.ODBCCLIUnixInterface</class-id> </initialize> <do-it>"Imported Classes:"</do-it> <do-it>self error: 'Attempting to file-in parcel imports. Choose terminate or close'</do-it> <class> <name>ODBCCLIInterface</name> <environment>Database</environment> <super>External.ExternalInterface</super> <private>false</private> <indexed-type>none</indexed-type> <inst-vars>encoding </inst-vars> <class-inst-vars>getSelectorMap fSqlTypeToConversionMap fetchBufferSizeBlocks putSelectorMap fCTypeFromConversionMap fSqlTypeFromConversionMap valueSizeBlocks valuePrecisionBlocks dataChunkSize </class-inst-vars> <imports> private Database.ODBCCLIInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles></libraryFiles> <libraryDirectories></libraryDirectories> <beVirtual>true</beVirtual> <optimizationLevel>full</optimizationLevel> <package>ODBCEXDI</package> </attributes> </class> </st-source>