Archive for February, 2012

Datatype serialization from Java to Actionscript

February 24, 2012

Chances are there that we might mistake the datatype, when it gets serialized from Java objects to AS3 objects. The table below shows the java datatype and its corresponding AS3 datatype. This is an excerpt from the live docs.

Java type ActionScript type (AMF 3)
enum (JDK 1.5) String
java.lang.String String
java.lang.Boolean, boolean Boolean
java.lang.Integer, int intIf value < 0xF0000000 || value > 0x0FFFFFFF, the value is promoted to Number due to AMF encoding requirements.
java.lang.Short, short intIf i < 0xF0000000 || i > 0x0FFFFFFF, the value is promoted to Number.
java.lang.Byte, byte[] intIf i < 0xF0000000 || i > 0x0FFFFFFF, the value is promoted to Number.
java.lang.Byte[] flash.utils.ByteArray
java.lang.Double, double Number
java.lang.Long, long Number
java.lang.Float, float Number
java.lang.Character, char String
java.lang.Character[], char[] String
java. math.BigInteger String
java.math.BigDecimal String
java.util.Calendar DateDates are sent in the Coordinated Universal Time (UTC) time zone. Clients and servers must adjust time accordingly for time zones.
java.util.Date DateDates are sent in the UTC time zone. Clients and servers must adjust time accordingly for time zones.
java.util.Collection (for example, java.util.ArrayList) mx.collections.ArrayCollection
java.lang.Object[] Array
java.util.Map Object (untyped). For example, a java.util.Map[] is converted to an Array (of Objects).
java.util.Dictionary Object (untyped)
org.w3c.dom.Document XML object
null null
java.lang.Object (other than previously listed types) Typed ObjectObjects are serialized using Java bean introspection rules and also include public fields. Fields that are static, transient, or nonpublic, as well as bean properties that are nonpublic or static, are excluded.

That’s it guys. Happy Coding. 🙂

Advertisements

Execute SQLLdr without tnsnames.ora entry

February 1, 2012

In my last post, I discovered that we can run sqlplus without having an entry in tnsnames. I was under the impression that it will work the same way in sqlldr also. But it was a mistake as sqlldr told me I am giving it the wrong syntax. I spend lots of time on that to find out finally that, I need to escape the brackets and need to put a double quotes which itself should be escaped around the connection string. So it goes like this :

sqlldr username/pwd@\”\(DESCRIPTION=\(ADDRESS=\(PROTOCOL=TCP\)\(HOST=yourhost.domain\)\(PORT=1521\)\)\(CONNECT_DATA=\(SERVER=DEDICATED\)\(SID=yourservice\)\)\)\” control=control_file.ctl errors=1000 ROWS=50000

That’s it guys. Happy Coding. 🙂


%d bloggers like this: