=== modified file 'interface/ndbapi/NdbRecAttr.i'
--- a/interface/ndbapi/NdbRecAttr.i	2008-02-16 17:04:54 +0000
+++ b/interface/ndbapi/NdbRecAttr.i	2008-03-05 16:01:55 +0000
@@ -91,11 +91,35 @@
 
   %ndbexception("NdbApiException") {
     $action
+      if ( (result.theNumbers == NULL) || 
+           (result.thePrecision == -1) || 
+           (result.theScale == -1)
+         )  { 
+         NDB_exception(NdbApiException,"Error fetching data");
+      }
+  }
+
+  DECIMAL getDecimal() { 
+    NdbDictionary::Column::Type colType = self->getType();
+    DECIMAL output; 
+    output.theNumbers=NULL;
+    output.thePrecision=-1;
+    output.theScale=1;
+
+    char* rec = self->aRef();
+    if(colType == NdbDictionary::Column::Decimal) {
+
+    }
+    return output;
+
+  } 
+
+  %ndbexception("NdbApiException") {
+    $action
       if ( (result.theString == NULL) || (result.theLength == -1) )  { 
 	NDB_exception(NdbApiException,"Error fetching data");
       }
   }
-
   BYTES getBytes() { 
     NdbDictionary::Column::Type colType = self->getType();
     BYTES output; 

=== modified file 'interface/ndbapi/ndbglobals.i'
--- a/interface/ndbapi/ndbglobals.i	2008-03-01 04:27:22 +0000
+++ b/interface/ndbapi/ndbglobals.i	2008-03-05 16:01:55 +0000
@@ -61,6 +61,12 @@
   int theLength;
 } BYTES;
 
+typedef struct st_decimal { 
+  int * theNumbers; 
+  int thePrecision; 
+  int theScale; 
+} DECIMAL; 
+
 class NdbDateTime
 {
   public:
@@ -129,4 +135,12 @@
 typedef const char * NdbTime; 
 typedef Uint32 NdbTimestamp;
 
+typedef struct st_decimal { 
+  // declaring as array here just to fool swig
+  int theNumbers[256]; 
+  int thePrecision; 
+  int theScale; 
+} DECIMAL; 
+
+
 

=== modified file 'java/Makefile.am'
--- a/java/Makefile.am	2008-02-16 17:04:54 +0000
+++ b/java/Makefile.am	2008-03-05 16:01:55 +0000
@@ -6,6 +6,7 @@
 ndbapi_examples_dir=$(package_namespace)/ndbapi/examples
 NDBAPI_BUILT_J = ${package_builddir}/ndbj/ndbj.java \
 	${package_builddir}/ndbj/ndbjConstants.java \
+	${package_builddir}/ndbj/DECIMAL.java \
 	${package_builddir}/ndbj/ndbjJNI.java \
 	${package_builddir}/ndbj/NdbRecAttrImpl.java \
 	${package_builddir}/ndbj/NdbColumn.java \
@@ -317,6 +318,7 @@
 	${builddir}/testsuite/ndbj/OutOfConnectionProblemTest.class \
 	${package_builddir}/ndbj/ndbj.class \
 	${package_builddir}/ndbj/ndbjConstants.class \
+	${package_builddir}/ndbj/DECIMAL.class \
 	${package_builddir}/ndbj/ndbjJNI.class \
 	${package_builddir}/ndbj/NdbRecAttrImpl.class \
 	${package_builddir}/ndbj/NdbColumn.class \

=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2008-02-16 17:04:54 +0000
+++ b/java/ndbj.i	2008-03-05 16:01:55 +0000
@@ -32,6 +32,7 @@
 %rename NdbScanOperation NdbScanOperationImpl;
 %rename NdbTransaction NdbTransactionImpl;
 
+%include "arrays_java.i"
 
 %include "ndbapi/ndbglobals.i"
 %include "various.i"
@@ -47,6 +48,7 @@
 
 %include "timestamp.i"
 %include "byte_array.i"
+%include "decimal.i"
 
 %include "names_array.i"
 

=== added file 'java/swig/decimal.i'
--- a/java/swig/decimal.i	1970-01-01 00:00:00 +0000
+++ b/java/swig/decimal.i	2008-03-05 16:01:55 +0000
@@ -0,0 +1,42 @@
+// -*- mode: c++ -*-
+/*  ndb-bindings: Bindings for the NDB API
+    Copyright (C) 2006 MySQL, Inc.
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or 
+    (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+//%typemap(jni) DECIMAL "jbyteArray"
+//%typemap(jtype) DECIMAL "byte[]"
+%typemap(jstype) DECIMAL "java.math.BigDecimal"
+%typemap(javaout) DECIMAL { 
+  // TODO 
+  DECIMAL theDecimal = new DECIMAL($jnicall, false);
+  java.math.BigDecimal results = new java.math.BigDecimal(0);
+  return results;
+} 
+
+
+/*%typemap(out) (BYTES)  { 
+ 
+ $result = jenv->NewByteArray($1.theLength); 
+ jenv->SetByteArrayRegion($result,0,$1.theLength,(jbyte*) $1.theString);
+ 
+} 
+
+%typemap(in) (const char* BYTE, size_t len) { 
+  $1 = (char *)(jenv->GetByteArrayElements($input,0));
+  $2 = jenv->GetArrayLength($input);
+ }
+*/



