Hi!
Somebody knows how can I connect to a 10g Oracle Server (running on windows) from QNX 6.3?
Thank you!
Regards,
Juan Manuel
Hi!
Somebody knows how can I connect to a 10g Oracle Server (running on windows) from QNX 6.3?
Thank you!
Regards,
Juan Manuel
Ethernet? TCP/IP? ODBC? SQL? I don’t think I’ve answered your question. Is there more to the question?
Thank you maschoen!!
Yes… sure… Everything is possible… I know… I just wondering which would be the most direct method, or better, “which is already done…”
I thinked ODBC as first choice, but is there an ODBC library already done or compiled for QNX to access Oracle? I don’t think so…
Is there someone who already did it in some way?
Thank you!!!
Juan Manuel
Hi again… Sorry, but this Oracle DB is driving me mad! The thing is:
I need to query an Oracle DB and I think the best way is doing so in XML format, because I don’t find some ODBC driver for QNX.
I’ve made some progress but they’re still not enough.
I wrote a FIXED query (just a SELECT) from JDeveloper (here is my big lack of knowledge) and then I run it. Doing so, a tcp service listening to specific port was created. (I also have a program called lsnrctl running at server side)
After this I wrote a tcp client wich opens a socket to that IP/PORT, and then write something like: “Application1-test1-context-root/query.xsql” wich is a virtual directory where query.xsql was created by me (well, that’s my guess).
Ok, I happily have the result of my FIXED query in XML format:
<?xml version="1.0" encoding="windows-1252"?> value_1 value_2 value_3 value_4 value_A value_B value_C value_D : :Even I can access this data from Voyager, or any browser just pointing to:
IP:PORT/Application1-test1-conte … query.xsql and everything works just fine.
I bet you already know my question. I need to pass the query as a dynamic parameter. Something like:
http:IP:PORT/…?SQL=“SELECT * FROM MY_TABLE WHERE my_condition ORDER BY my_column” from the browser or my client, it doesn’t really matter.
Well, have you ever have met with an Oracle DB? Or similar?
I will appreciate any suggestion !!
Thank you in advance !
JM
This post is just for historical purposes. Now it’s working, I want to post this simple guide if someone ever needs to communicate to Oracle from QNX node. It’s simple (once you know the way ).
Obviously is not the only way to do it
Prerequisites:
a) Oracle 10g (I think it works with 9i and 8i, but 8i needs to install the xsql functionality)
b) J2SE 1.3.1 or later
Now,
Install OC4J Servlet Container in stand alone mode. It’s a ZIP file. oc4j_extended.zip
Unzip it (maybe ORACLE_HOME is the best place)
Now OC4J HOME is: ORACLE_HOME\oc4j_extended\j2ee\home
You must verify that the following files are in HOME\lib (OC4J HOME not ORACLE_HOME)
a. xmlparserv2.jar
b. classes12.jar
You must add these ones to the same directory (this is very important):
a. xsu12.jar
b. oraclexsql.jar
c. xsqlserializers.jar
Copy XSQLConfig.xml to HOME\ default-web-app\WEB-INF\classes
Edit this file to configure the connection. Like this:
Note the SID: Put yours!
8 ) now is time to configure OC4J to make it able to execute .XSQL Servlets Template Files. Edit HOME\config\global-web-application.xml and add:
xsql oracle.xml.xsql.XSQLServlet xsql /*.xsql
This was just my example.
Define JAVA_HOME env variable (Eg: C:\Programs Files\Java\jdk1.5.0_06)
Create .xsql file (maybe this is the most important step). For example query.xsql
<xsql:query connection=“your_connection” xmlns:xsql=“urn:oracle-xsql” date-format=“yyyy-MM-dd HH:mm:ss”>
{@sql}
</xsql:query>
And save it in the real-path associated to the virtual-path (step 9)
{@sql} will be replace by your own dynamic query.
Start OC4J server (there is a .cmd file somewhere)
Try from your browser: localhost:8888 (8888 is just the default port, you can change if you want)
It must show you OC4J home page
Final test: Try: localhost:8888/xsql/query.xsql?sql=<sql_query>
If you see the XML response, all it’s done.
Well… it’s up to you to: (this could be little hard for newbies)
Error checking/format checking/time outs… well, this needs some work.
Last notes:
If XML if big enough, the page will be naturally chunked (check this when parsing)
The default heap-size of JVM (wich is used for data exchange) is 2MB, so if is not enough for you, you must change this default in order to avoid heap-exhausted error.
I hope this helps… I struggled enough to make it work…
Regards,
JM
Great info!