I have a small project to use a jar file for sending/receiving SMS in chinese. I could send the SMS fine from Eclipse, so I thought creating a Java Class wrapper to be used by ColdFusion so it can be called from HTTP could do the trick.
After a few minutes, I have the class up and running and fully tested within Eclipse.
1. I dropped the class, dll and its jar in C:\ColdFusion8\lib. Take note its a Windows box, since the Jar is using a dll to talk to the Wavecom modem using AT commands.
GSMModem.jar
GSMMultiPort.dll
GSMMultiPortForJ.dll
2. The crux was to specify the file.encoding for Java as an argument from the CFIDE Administrator. After specifying GB18030, a quick restart.. voila..
Java Version 1.6.0_01
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home C:\ColdFusion8\runtime\jre
Java File Encoding GB18030
Java Default Locale en_US
File Separator \
Path Separator ;
Line Separator Chr(13)
User Name SYSTEM
User Home C:\
Files:
CFSend.java
Stumbled upon an error in reprojecting data from 900913 (Google Speherical Mercator) to 4326 (WGS84). I’m recalling this from my head now, the error was something related to “NAD sth”. Workaround was to convert it as follows:
1. 900913
2. 32650 (UTM for your area)
3. 4326
I’ll get the SQL from my ofcmate and paste it here…
EXPLAIN PLAN
1. Create the PLAN_TABLE
SQL> $ORACLE_HOME/rdbms/admin/utlxplan.sql
2. Run EXPLAIN PLAN for an SQL
SQL> EXPLAIN PLAN
2 SET STATEMENT_ID = ‘example’ FOR
3 SELECT ename,dname
4 FROM emp inner join dept
5 ON ( emp.deptno = dept.deptno )
6 /
Explained.
3. DISPLAY Results
SQL> $ORACLE_HOME/rdbms/admin/utlxpls.sql
AUTOTRACE is a SQL*Plus facility that may be enabled in your database. To get this up and running you need to have administration rights to the system and perform the following steps:
* Log into SQL*Plus as SYSDBA
* Run the script $ORACLE_HOME/sqlplus/admin/plustrce
* Grant PLUSTRACE to SPATIAL (or to specific users/roles)
To Use:
SQL> SET autotrace ON
SQL> SELECT ename,dname
2 FROM emp INNER JOIN dept
3 ON ( emp.deptno = dept.deptno )
4 /
ENAME DNAME
---------- --------------
SMITH RESEARCH
ALLEN SALES
WARD SALES
JONES RESEARCH
MARTIN SALES
BLAKE SALES
CLARK ACCOUNTING
SCOTT RESEARCH
KING ACCOUNTING
TURNER SALES
ADAMS RESEARCH
JAMES SALES
FORD RESEARCH
MILLER ACCOUNTING
14 rows selected.
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=14 Bytes=252)
1 0 HASH JOIN (Cost=3 Card=14 Bytes=252)
2 1 TABLE ACCESS (FULL) OF 'DEPT' (Cost=1 Card=4 Bytes=44)
3 1 TABLE ACCESS (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=98)
Statistics
----------------------------------------------------------
0 recursive calls
4 db block gets
3 consistent gets
0 physical reads
0 redo size
1132 bytes sent via SQL*Net TO client
503 bytes received via SQL*Net FROM client
2 SQL*Net roundtrips TO/FROM client
0 sorts (memory)
0 sorts (disk)
14 rows processed
Courtesy of Beginning Oracle Programming by Sean Dillon et al
Read more…
It was a gruesome day.. I have an oracle10g on my MacBookPro running on VMWare (WindowsXPSP3, let’s call this orawin). I have another setup box (CentOS5 + oracle11g = oralin) just this morning. I imported the tables from my orawin10g to my oralin11g, created the indexes for the tables in oralin11g. I ran my spatial test query on orawin10(0.692192571 secs); I ran the same query on oralin11g (14.89 secs). I viewed the execution plans and both are the same!
Eventually, whatever works.. I have to drop the oracle11g and install Oracle10g instead. I have updated the Tutorials Page to include this, as well as the Oracle CheatSheet.