We still use a lot of Oracle Forms 6i programs in-house and for our customers. One of the issue is that users do not want to install the Forms 6i runtime client on each PC and it also creates deployment issue unless we share out the FMX programs from a central file server. Also, since Forms 6i is only a 32-bit software, it should run only on Windows Server 2003 32-bits Terminal Server, although some users have tried making it work on Windows 7 64-bit. This create another issue on the need to have MS Terminal Service licenses.
However there is another way, which does not even require a MS Terminal Services, and that is to use the following set of packages on Linux: Wine, XRDP and VNC Server.
We started first by installing the XRDP (version 0.5.0) package and VNC-server, running on Centos 5.4, to allow the Remote Desktop Connection program to connect to a window session on the linux server. We have tested this on both Windows XP and Windows 7. Add a new user and test out the remote desktop access to the linux server (the window will ask you for a userid and password). It may start up a window manager (if there are any installed) or just open an xterm.
Next, using the latest version of Wine (1.3.31), we have managed to install the Oracle Forms 6i (Release 2 for XP with Patch 18) runtime and run WITHOUT recompiling the FMX, our existing Forms programs. One problem we faced was that you need to CUSTOM install the Oracle TCP Protocol Adapter which for some reason does not install by default. Also, you may want to install the MS Windows TrueType fonts if it will help. The Forms 6i programs were all installed in the user which we created earlier for the XRDP access.
With that in placed, you can create start-up scripts to auto-run a specific Forms program (via Wine). If you want the XRDP to auto-run your start-up script, you can try modifying the /etc/xrdp/startwm.sh script.
This is a blog on my ramblings as both the IT support as well as the CTO of my company, exploring new technologies and sharing the experience.
Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts
Wednesday, November 2, 2011
Sunday, September 18, 2011
Oracle OrdAudio and Grails
Recently I have started prototyping some web applications on Grails that uses the Oracle interMedia capabilities. One of the key problems is that you cannot use GORM to define a property which is an Oracle OrdMedia component, such as OrdAudio. I needed a way to stream out the audio data stored in this field in an Oracle database for which I created a Controller in Grails. But how do you retrieve the field object ?
Firstly I used Groovy SQL to get hold of the field by doing the following:
import groovy.sql.Sql
class StreamingController {
def sessionFactory
def index = {
String sqlstr = "select audio_file table where id = ?"
Sql sql = new Sql(sessionFactory.currentSession.connection())
sql.eachRow(sqlstr,[params.id]) { row ->
println row[0]
}
}
}
Invoking the "streaming" url, Grails report that the row[0] is a oracle.sql.STRUCT object. So how do I convert that into an OrdAudio object ?
Turns out that Oracle uses a Factory to build the OrdAudio object from the STRUCT.
sql.eachRow(sqlstr,[params.id]) { row ->
oracle.sql.STRUCT str = row[0]
oracle.sql.CustomDatumFactory factory = oracle.ord.im.OrdAudio.getFactory()
oracle.ord.im.OrdAudio audio = factory.create(str, java.sql.Types.STRUCT)
...
}
So you now have the OrdAudio object for which you can check its properties or extract the audio data out. If the data is stored in the BLOB, then you will use:
InputStream inp = audio.getDataInStream()
If the data is stored in a BFILE, then you will use:
oracle.sql.BFILE bfile = audio.getBFILE()
bfile.open()
InputStream inp = bfile.getBinaryStream()
You can then stream the data into the "response.outputStream" using the write method.
Firstly I used Groovy SQL to get hold of the field by doing the following:
import groovy.sql.Sql
class StreamingController {
def sessionFactory
def index = {
String sqlstr = "select audio_file table where id = ?"
Sql sql = new Sql(sessionFactory.currentSession.connection())
sql.eachRow(sqlstr,[params.id]) { row ->
println row[0]
}
}
}
Invoking the "streaming" url, Grails report that the row[0] is a oracle.sql.STRUCT object. So how do I convert that into an OrdAudio object ?
Turns out that Oracle uses a Factory to build the OrdAudio object from the STRUCT.
sql.eachRow(sqlstr,[params.id]) { row ->
oracle.sql.STRUCT str = row[0]
oracle.sql.CustomDatumFactory factory = oracle.ord.im.OrdAudio.getFactory()
oracle.ord.im.OrdAudio audio = factory.create(str, java.sql.Types.STRUCT)
...
}
So you now have the OrdAudio object for which you can check its properties or extract the audio data out. If the data is stored in the BLOB, then you will use:
InputStream inp = audio.getDataInStream()
If the data is stored in a BFILE, then you will use:
oracle.sql.BFILE bfile = audio.getBFILE()
bfile.open()
InputStream inp = bfile.getBinaryStream()
You can then stream the data into the "response.outputStream" using the write method.
Subscribe to:
Posts (Atom)