<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,7 +20,7 @@ task :java_compile do
   pkg_classes = File.join(*%w(pkg classes))
   jar_name = File.join(*%w(lib jdbc_adapter jdbc_adapter_internal.jar))
   mkdir_p pkg_classes
-  sh &quot;javac -target 1.4 -source 1.4 -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}&quot;
+  sh &quot;javac -target 1.5 -source 1.5 -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}&quot;
   sh &quot;jar cf #{jar_name} -C #{pkg_classes} .&quot;
 end
 file &quot;lib/jdbc_adapter/jdbc_adapter_internal.jar&quot; =&gt; :java_compile
@@ -87,7 +87,7 @@ end
 
 
 MANIFEST = FileList[&quot;History.txt&quot;, &quot;Manifest.txt&quot;, &quot;README.txt&quot;, 
-  &quot;Rakefile&quot;, &quot;LICENSE&quot;, &quot;lib/**/*.rb&quot;, &quot;lib/jdbc_adapter/jdbc_adapter_internal.jar&quot;, &quot;test/**/*.rb&quot;,
+  &quot;Rakefile&quot;, &quot;LICENSE.txt&quot;, &quot;lib/**/*.rb&quot;, &quot;lib/jdbc_adapter/jdbc_adapter_internal.jar&quot;, &quot;test/**/*.rb&quot;,
    &quot;lib/**/*.rake&quot;, &quot;src/**/*.java&quot;]
 
 file &quot;Manifest.txt&quot; =&gt; :manifest</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module JdbcAdapter
   module Version
-    VERSION = &quot;0.7.3&quot;
+    VERSION = &quot;0.8&quot;
   end
 end
\ No newline at end of file</diff>
      <filename>lib/jdbc_adapter/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -59,13 +59,13 @@ import org.jruby.RubyObjectAdapter;
 import org.jruby.RubyString;
 import org.jruby.RubySymbol;
 import org.jruby.RubyTime;
+import org.jruby.anno.JRubyMethod;
 import org.jruby.exceptions.RaiseException;
 import org.jruby.javasupport.Java;
 import org.jruby.javasupport.JavaEmbedUtils;
 import org.jruby.javasupport.JavaObject;
 import org.jruby.runtime.Arity;
 import org.jruby.runtime.Block;
-import org.jruby.runtime.CallbackFactory;
 import org.jruby.runtime.ThreadContext;
 import org.jruby.runtime.builtin.IRubyObject;
 import org.jruby.runtime.load.BasicLibraryService;
@@ -75,43 +75,13 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
     private static RubyObjectAdapter rubyApi;
 
     public boolean basicLoad(final Ruby runtime) throws IOException {
-        RubyClass cJdbcConn = ((RubyModule)(runtime.getModule(&quot;ActiveRecord&quot;).getConstant(&quot;ConnectionAdapters&quot;))).
+        ((RubyModule)(runtime.getModule(&quot;ActiveRecord&quot;).getConstant(&quot;ConnectionAdapters&quot;))).
             defineClassUnder(&quot;JdbcConnection&quot;,runtime.getObject(),runtime.getObject().getAllocator());
-
-        CallbackFactory cf = runtime.callbackFactory(JdbcAdapterInternalService.class);
-        cJdbcConn.defineMethod(&quot;unmarshal_result&quot;,cf.getSingletonMethod(&quot;unmarshal_result&quot;, IRubyObject.class));
-        cJdbcConn.defineMethod(&quot;with_connection_retry_guard&quot;,cf.getSingletonMethod(&quot;with_connection_retry_guard&quot;));
-        cJdbcConn.defineFastMethod(&quot;connection&quot;,cf.getFastSingletonMethod(&quot;connection&quot;));
-        cJdbcConn.defineFastMethod(&quot;reconnect!&quot;,cf.getFastSingletonMethod(&quot;reconnect&quot;));
-        cJdbcConn.defineFastMethod(&quot;disconnect!&quot;,cf.getFastSingletonMethod(&quot;disconnect&quot;));
-        cJdbcConn.defineFastMethod(&quot;execute_update&quot;,cf.getFastSingletonMethod(&quot;execute_update&quot;, IRubyObject.class));
-        cJdbcConn.defineFastMethod(&quot;execute_query&quot;,cf.getFastOptSingletonMethod(&quot;execute_query&quot;)); 
-        cJdbcConn.defineFastMethod(&quot;execute_insert&quot;,cf.getFastSingletonMethod(&quot;execute_insert&quot;, IRubyObject.class));
-        cJdbcConn.defineFastMethod(&quot;execute_id_insert&quot;,cf.getFastSingletonMethod(&quot;execute_id_insert&quot;, IRubyObject.class, IRubyObject.class));
-        cJdbcConn.defineFastMethod(&quot;primary_keys&quot;,cf.getFastSingletonMethod(&quot;primary_keys&quot;, IRubyObject.class));
-        cJdbcConn.defineFastMethod(&quot;set_native_database_types&quot;,cf.getFastSingletonMethod(&quot;set_native_database_types&quot;));
-        cJdbcConn.defineFastMethod(&quot;native_database_types&quot;,cf.getFastSingletonMethod(&quot;native_database_types&quot;));
-        cJdbcConn.defineFastMethod(&quot;begin&quot;,cf.getFastSingletonMethod(&quot;begin&quot;));
-        cJdbcConn.defineFastMethod(&quot;commit&quot;,cf.getFastSingletonMethod(&quot;commit&quot;));
-        cJdbcConn.defineFastMethod(&quot;rollback&quot;,cf.getFastSingletonMethod(&quot;rollback&quot;));
-        cJdbcConn.defineFastMethod(&quot;database_name&quot;,cf.getFastSingletonMethod(&quot;database_name&quot;));
-        cJdbcConn.defineFastMethod(&quot;columns&quot;,cf.getFastOptSingletonMethod(&quot;columns_internal&quot;));
-        cJdbcConn.defineFastMethod(&quot;columns_internal&quot;,cf.getFastOptSingletonMethod(&quot;columns_internal&quot;));
-        cJdbcConn.defineFastMethod(&quot;tables&quot;,cf.getFastOptSingletonMethod(&quot;tables&quot;));
-
-        cJdbcConn.defineFastMethod(&quot;insert_bind&quot;,cf.getFastOptSingletonMethod(&quot;insert_bind&quot;));
-        cJdbcConn.defineFastMethod(&quot;update_bind&quot;,cf.getFastOptSingletonMethod(&quot;update_bind&quot;));
-
-        cJdbcConn.defineFastMethod(&quot;write_large_object&quot;,cf.getFastOptSingletonMethod(&quot;write_large_object&quot;));
-
-        cJdbcConn.getMetaClass().defineFastMethod(&quot;insert?&quot;,cf.getFastSingletonMethod(&quot;insert_p&quot;, IRubyObject.class));
-        cJdbcConn.getMetaClass().defineFastMethod(&quot;select?&quot;,cf.getFastSingletonMethod(&quot;select_p&quot;, IRubyObject.class));
-
         RubyModule jdbcSpec = runtime.getOrCreateModule(&quot;JdbcSpec&quot;);
 
         rubyApi = JavaEmbedUtils.newObjectAdapter();
-        JdbcMySQLSpec.load(runtime, jdbcSpec);
-        JdbcDerbySpec.load(runtime, jdbcSpec, rubyApi);
+        JdbcMySQLSpec.load(jdbcSpec);
+        JdbcDerbySpec.load(jdbcSpec, rubyApi);
         return true;
     }
 
@@ -131,6 +101,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return p;
     }
 
+    @JRubyMethod(name = &quot;insert?&quot;, required = 1)
     public static IRubyObject insert_p(IRubyObject recv, IRubyObject _sql) {
         ByteList bl = rubyApi.convertToRubyString(_sql).getByteList();
 
@@ -169,6 +140,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return recv.getRuntime().getFalse();
     }
 
+    @JRubyMethod(name = &quot;select?&quot;, required = 1)
     public static IRubyObject select_p(IRubyObject recv, IRubyObject _sql) {
         ByteList bl = rubyApi.convertToRubyString(_sql).getByteList();
 
@@ -224,6 +196,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return recv.getRuntime().getFalse();
     }
 
+    @JRubyMethod(name = &quot;connection&quot;)
     public static IRubyObject connection(IRubyObject recv) {
         Connection c = getConnection(recv);
         if (c == null) {
@@ -232,16 +205,19 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return rubyApi.getInstanceVariable(recv, &quot;@connection&quot;);
     }
 
+    @JRubyMethod(name = &quot;disconnect&quot;)
     public static IRubyObject disconnect(IRubyObject recv) {
         setConnection(recv, null);
         return recv;
     }
 
+    @JRubyMethod(name = &quot;reconnect&quot;)
     public static IRubyObject reconnect(IRubyObject recv) {
         setConnection(recv, getConnectionFactory(recv).newConnection());
         return recv;
     }
 
+    @JRubyMethod(name = &quot;with_connection_retry_guard&quot;, frame = true)
     public static IRubyObject with_connection_retry_guard(final IRubyObject recv, final Block block) {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -322,6 +298,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         };
     }
 
+    @JRubyMethod(name = &quot;tables&quot;, rest = true)
     public static IRubyObject tables(final IRubyObject recv, IRubyObject[] args) {
         final Ruby runtime     = recv.getRuntime();
         final String catalog   = getCatalog(args);
@@ -370,10 +347,12 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return types;
     }
 
+    @JRubyMethod(name = &quot;native_database_types&quot;)
     public static IRubyObject native_database_types(IRubyObject recv) {
         return rubyApi.getInstanceVariable(recv, &quot;@tps&quot;);
     }    
 
+    @JRubyMethod(name = &quot;set_native_database_types&quot;)
     public static IRubyObject set_native_database_types(IRubyObject recv) throws SQLException, IOException {
         Ruby runtime = recv.getRuntime();
         IRubyObject types = unmarshal_result_downcase(recv, getConnection(recv).getMetaData().getTypeInfo());
@@ -383,6 +362,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return runtime.getNil();
     }
 
+    @JRubyMethod(name = &quot;database_name&quot;)
     public static IRubyObject database_name(IRubyObject recv) throws SQLException {
         String name = getConnection(recv).getCatalog();
         if(null == name) {
@@ -394,11 +374,13 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return recv.getRuntime().newString(name);
     }
 
+    @JRubyMethod(name = &quot;begin&quot;)
     public static IRubyObject begin(IRubyObject recv) throws SQLException {
         getConnection(recv).setAutoCommit(false);
         return recv.getRuntime().getNil();
     }
 
+    @JRubyMethod(name = &quot;commit&quot;)
     public static IRubyObject commit(IRubyObject recv) throws SQLException {
         try {
             getConnection(recv).commit();
@@ -408,6 +390,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         }
     }
 
+    @JRubyMethod(name = &quot;rollback&quot;)
     public static IRubyObject rollback(IRubyObject recv) throws SQLException {
         try {
             getConnection(recv).rollback();
@@ -417,6 +400,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         }
     }
 
+    @JRubyMethod(name = {&quot;columns&quot;, &quot;columns_internal&quot;})
     public static IRubyObject columns_internal(final IRubyObject recv, final IRubyObject[] args) throws SQLException, IOException {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -548,6 +532,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         }
     }
 
+    @JRubyMethod(name = &quot;primary_keys&quot;, required = 1)
     public static IRubyObject primary_keys(final IRubyObject recv, final IRubyObject _table_name) throws SQLException {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -579,6 +564,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         });
     }
 
+    @JRubyMethod(name = &quot;execute_id_insert&quot;, required = 2)
     public static IRubyObject execute_id_insert(IRubyObject recv, final IRubyObject sql, final IRubyObject id) throws SQLException {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -594,6 +580,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         });
     }
 
+    @JRubyMethod(name = &quot;execute_update&quot;, required = 1)
     public static IRubyObject execute_update(final IRubyObject recv, final IRubyObject sql) throws SQLException {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -613,6 +600,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         });
     }
 
+    @JRubyMethod(name = &quot;execute_query&quot;, rest = true)
     public static IRubyObject execute_query(final IRubyObject recv, IRubyObject[] args) throws SQLException, IOException {
         final IRubyObject sql = args[0];
         final int maxrows;
@@ -642,6 +630,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         });
     }
 
+    @JRubyMethod(name = &quot;execute_insert&quot;, required = 1)
     public static IRubyObject execute_insert(final IRubyObject recv, final IRubyObject sql) throws SQLException {
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
@@ -734,6 +723,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         return runtime.newArray(results);
     }
 
+    @JRubyMethod(name = &quot;unmarshal_result&quot;, required = 1)
     public static IRubyObject unmarshal_result(IRubyObject recv, IRubyObject resultset, Block row_filter) throws SQLException, IOException {
         Ruby runtime = recv.getRuntime();
         ResultSet rs = intoResultSet(resultset);
@@ -896,7 +886,8 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
     
     private final static DateFormat FORMAT = new SimpleDateFormat(&quot;%y-%M-%d %H:%m:%s&quot;);
 
-    private static void setValue(PreparedStatement ps, int index, Ruby runtime, IRubyObject value, IRubyObject type) throws SQLException {
+    private static void setValue(PreparedStatement ps, int index, Ruby runtime, ThreadContext context,
+            IRubyObject value, IRubyObject type) throws SQLException {
         final int tp = getTypeValueFor(runtime, type);
         if(value.isNil()) {
             ps.setNull(index, tp);
@@ -906,7 +897,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         switch(tp) {
         case Types.VARCHAR:
         case Types.CLOB:
-            ps.setString(index, RubyString.objAsString(value).toString());
+            ps.setString(index, RubyString.objAsString(context, value).toString());
             break;
         case Types.INTEGER:
             ps.setLong(index, RubyNumeric.fix2long(value));
@@ -919,10 +910,10 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         case Types.DATE:
             if(!(value instanceof RubyTime)) {
                 try {
-                    Date dd = FORMAT.parse(RubyString.objAsString(value).toString());
+                    Date dd = FORMAT.parse(RubyString.objAsString(context, value).toString());
                     ps.setTimestamp(index, new java.sql.Timestamp(dd.getTime()), Calendar.getInstance());
                 } catch(Exception e) {
-                    ps.setString(index, RubyString.objAsString(value).toString());
+                    ps.setString(index, RubyString.objAsString(context, value).toString());
                 }
             } else {
                 RubyTime rubyTime = (RubyTime) value;
@@ -943,27 +934,28 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
         }
     }
 
-    private static void setValuesOnPS(PreparedStatement ps, Ruby runtime, IRubyObject values, IRubyObject types) throws SQLException {
+    private static void setValuesOnPS(PreparedStatement ps, Ruby runtime, ThreadContext context,
+            IRubyObject values, IRubyObject types) throws SQLException {
         RubyArray vals = (RubyArray)values;
         RubyArray tps = (RubyArray)types;
 
         for(int i=0, j=vals.getLength(); i&lt;j; i++) {
-            setValue(ps, i+1, runtime, vals.eltInternal(i), tps.eltInternal(i));
+            setValue(ps, i+1, runtime, context, vals.eltInternal(i), tps.eltInternal(i));
         }
     }
 
     /*
      * sql, values, types, name = nil, pk = nil, id_value = nil, sequence_name = nil
      */
-    public static IRubyObject insert_bind(IRubyObject recv, final IRubyObject[] args) throws SQLException {
+    @JRubyMethod(name = &quot;insert_bind&quot;, required = 3, rest = true)
+    public static IRubyObject insert_bind(final ThreadContext context, IRubyObject recv, final IRubyObject[] args) throws SQLException {
         final Ruby runtime = recv.getRuntime();
-        Arity.checkArgumentCount(runtime, args, 3, 7);
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
                 PreparedStatement ps = null;
                 try {
                     ps = c.prepareStatement(rubyApi.convertToRubyString(args[0]).toString(), Statement.RETURN_GENERATED_KEYS);
-                    setValuesOnPS(ps, runtime, args[1], args[2]);
+                    setValuesOnPS(ps, runtime, context, args[1], args[2]);
                     ps.executeUpdate();
                     return unmarshal_id_result(runtime, ps.getGeneratedKeys());
                 } finally {
@@ -979,7 +971,8 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
     /*
      * sql, values, types, name = nil
      */
-    public static IRubyObject update_bind(IRubyObject recv, final IRubyObject[] args) throws SQLException {
+    @JRubyMethod(name = &quot;update_bind&quot;, required = 3, rest = true)
+    public static IRubyObject update_bind(final ThreadContext context, IRubyObject recv, final IRubyObject[] args) throws SQLException {
         final Ruby runtime = recv.getRuntime();
         Arity.checkArgumentCount(runtime, args, 3, 4);
         return withConnectionAndRetry(recv, new SQLBlock() {
@@ -987,7 +980,7 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
                 PreparedStatement ps = null;
                 try {
                     ps = c.prepareStatement(rubyApi.convertToRubyString(args[0]).toString());
-                    setValuesOnPS(ps, runtime, args[1], args[2]);
+                    setValuesOnPS(ps, runtime, context, args[1], args[2]);
                     ps.executeUpdate();
                 } finally {
                     try {
@@ -1003,10 +996,10 @@ public class JdbcAdapterInternalService implements BasicLibraryService {
     /*
      * (is binary?, colname, tablename, primary key, id, value)
      */
+    @JRubyMethod(name = &quot;write_large_object&quot;, required = 6)
     public static IRubyObject write_large_object(IRubyObject recv, final IRubyObject[] args)
             throws SQLException, IOException {
         final Ruby runtime = recv.getRuntime();
-        Arity.checkArgumentCount(runtime, args, 6, 6);
         return withConnectionAndRetry(recv, new SQLBlock() {
             public IRubyObject call(Connection c) throws SQLException {
                 String sql = &quot;UPDATE &quot; + rubyApi.convertToRubyString(args[2])</diff>
      <filename>src/java/jdbc_adapter/JdbcAdapterInternalService.java</filename>
    </modified>
    <modified>
      <diff>@@ -35,35 +35,27 @@ import org.jruby.RubyBigDecimal;
 import org.jruby.RubyRange;
 import org.jruby.RubyNumeric;
 
-import org.jruby.runtime.Arity;
-import org.jruby.runtime.CallbackFactory;
-import org.jruby.runtime.MethodIndex;
 import org.jruby.runtime.builtin.IRubyObject;
 
 import org.jruby.util.ByteList;
 
 import java.sql.SQLException;
 import org.jruby.RubyObjectAdapter;
+import org.jruby.anno.JRubyMethod;
+import org.jruby.runtime.ThreadContext;
 
 public class JdbcDerbySpec {
     private static RubyObjectAdapter rubyApi;
-    public static void load(Ruby runtime, RubyModule jdbcSpec, RubyObjectAdapter adapter) {
+    public static void load(RubyModule jdbcSpec, RubyObjectAdapter adapter) {
         RubyModule derby = jdbcSpec.defineModuleUnder(&quot;Derby&quot;);
-        CallbackFactory cf = runtime.callbackFactory(JdbcDerbySpec.class);
-        derby.defineFastMethod(&quot;quote_string&quot;,cf.getFastSingletonMethod(&quot;quote_string&quot;,IRubyObject.class));
-        derby.defineFastMethod(&quot;quote&quot;,cf.getFastOptSingletonMethod(&quot;quote&quot;));
-        derby.defineFastMethod(&quot;_execute&quot;,cf.getFastOptSingletonMethod(&quot;_execute&quot;));
-        derby.defineFastMethod(&quot;add_limit_offset!&quot;,cf.getFastSingletonMethod(&quot;add_limit_offset&quot;, IRubyObject.class, IRubyObject.class));
-        derby.defineFastMethod(&quot;select_all&quot;,cf.getFastOptSingletonMethod(&quot;select_all&quot;));
-        derby.defineFastMethod(&quot;select_one&quot;,cf.getFastOptSingletonMethod(&quot;select_one&quot;));
-        RubyModule col = derby.defineModuleUnder(&quot;Column&quot;);
-        col.defineFastMethod(&quot;type_cast&quot;,cf.getFastSingletonMethod(&quot;type_cast&quot;, IRubyObject.class));
+        derby.defineModuleUnder(&quot;Column&quot;);
         rubyApi = adapter;
     }
 
     /*
      * JdbcSpec::Derby::Column.type_cast(value)
      */
+    @JRubyMethod(name = &quot;type_cast&quot;, required = 1)
     public static IRubyObject type_cast(IRubyObject recv, IRubyObject value) {
         Ruby runtime = recv.getRuntime();
 
@@ -109,9 +101,9 @@ public class JdbcDerbySpec {
         return value;
     }
 
-    public static IRubyObject quote(IRubyObject recv, IRubyObject[] args) {
+    @JRubyMethod(name = &quot;quote&quot;, required = 1, optional = 1)
+    public static IRubyObject quote(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
         Ruby runtime = recv.getRuntime();
-        Arity.checkArgumentCount(runtime, args, 1, 2);
         IRubyObject value = args[0];
         if (args.length &gt; 1) {
             IRubyObject col = args[1];
@@ -128,21 +120,21 @@ public class JdbcDerbySpec {
                     if (only_digits((RubyString)value)) {
                         return value;
                     } else {
-                        return super_quote(recv, runtime, value, col);
+                        return super_quote(context, recv, runtime, value, col);
                     }
                 }
             } else if ((value instanceof RubyFloat) || (value instanceof RubyFixnum) || (value instanceof RubyBignum)) {
                 if (type == runtime.newSymbol(&quot;string&quot;)) {
-                    return quote_string_with_surround(runtime, &quot;'&quot;, RubyString.objAsString(value), &quot;'&quot;);
+                    return quote_string_with_surround(runtime, &quot;'&quot;, RubyString.objAsString(context, value), &quot;'&quot;);
                 }
             }
         } 
-        return super_quote(recv, runtime, value, runtime.getNil());
+        return super_quote(context, recv, runtime, value, runtime.getNil());
     }
 
     private final static ByteList NULL = new ByteList(&quot;NULL&quot;.getBytes());
 
-    public static IRubyObject super_quote(IRubyObject recv, Ruby runtime, IRubyObject value, IRubyObject col) {
+    public static IRubyObject super_quote(ThreadContext context, IRubyObject recv, Ruby runtime, IRubyObject value, IRubyObject col) {
         if (value.respondsTo(&quot;quoted_id&quot;)) {
             return rubyApi.callMethod(value, &quot;quoted_id&quot;);
         }
@@ -151,11 +143,11 @@ public class JdbcDerbySpec {
         RubyModule multibyteChars = (RubyModule) 
                 ((RubyModule) ((RubyModule) runtime.getModule(&quot;ActiveSupport&quot;)).getConstant(&quot;Multibyte&quot;)).getConstantAt(&quot;Chars&quot;);
         if (value instanceof RubyString || rubyApi.isKindOf(value, multibyteChars)) {
-            RubyString svalue = RubyString.objAsString(value);
+            RubyString svalue = RubyString.objAsString(context, value);
             if (type == runtime.newSymbol(&quot;binary&quot;) &amp;&amp; col.getType().respondsTo(&quot;string_to_binary&quot;)) {
                 return quote_string_with_surround(runtime, &quot;'&quot;, (RubyString)(rubyApi.callMethod(col.getType(), &quot;string_to_binary&quot;, svalue)), &quot;'&quot;); 
             } else if (type == runtime.newSymbol(&quot;integer&quot;) || type == runtime.newSymbol(&quot;float&quot;)) {
-                return RubyString.objAsString(((type == runtime.newSymbol(&quot;integer&quot;)) ? 
+                return RubyString.objAsString(context, ((type == runtime.newSymbol(&quot;integer&quot;)) ?
                                                rubyApi.callMethod(svalue, &quot;to_i&quot;) : 
                                                rubyApi.callMethod(svalue, &quot;to_f&quot;)));
             } else {
@@ -168,11 +160,11 @@ public class JdbcDerbySpec {
                     (type == runtime.newSymbol(&quot;:integer&quot;)) ? runtime.newString(&quot;1&quot;) : rubyApi.callMethod(recv, &quot;quoted_true&quot;) :
                     (type == runtime.newSymbol(&quot;:integer&quot;)) ? runtime.newString(&quot;0&quot;) : rubyApi.callMethod(recv, &quot;quoted_false&quot;));
         } else if((value instanceof RubyFloat) || (value instanceof RubyFixnum) || (value instanceof RubyBignum)) {
-            return RubyString.objAsString(value);
+            return RubyString.objAsString(context, value);
         } else if(value instanceof RubyBigDecimal) {
             return rubyApi.callMethod(value, &quot;to_s&quot;, runtime.newString(&quot;F&quot;));
         } else if (rubyApi.isKindOf(value, runtime.getModule(&quot;Date&quot;))) {
-            return quote_string_with_surround(runtime, &quot;'&quot;, RubyString.objAsString(value), &quot;'&quot;); 
+            return quote_string_with_surround(runtime, &quot;'&quot;, RubyString.objAsString(context, value), &quot;'&quot;);
         } else if (rubyApi.isKindOf(value, runtime.getModule(&quot;Time&quot;)) || rubyApi.isKindOf(value, runtime.getModule(&quot;DateTime&quot;))) {
             return quote_string_with_surround(runtime, &quot;'&quot;, (RubyString)(rubyApi.callMethod(recv, &quot;quoted_date&quot;, value)), &quot;'&quot;); 
         } else {
@@ -232,6 +224,7 @@ public class JdbcDerbySpec {
         return true;
     }
 
+    @JRubyMethod(name = &quot;quote_string&quot;, required = 1)
     public static IRubyObject quote_string(IRubyObject recv, IRubyObject string) {
         boolean replacementFound = false;
         ByteList bl = ((RubyString) string).getByteList();
@@ -259,10 +252,12 @@ public class JdbcDerbySpec {
         }
     }
 
+    @JRubyMethod(name = &quot;select_all&quot;, rest = true)
     public static IRubyObject select_all(IRubyObject recv, IRubyObject[] args) {
         return rubyApi.callMethod(recv, &quot;execute&quot;, args);
     }
 
+    @JRubyMethod(name = &quot;select_one&quot;, rest = true)
     public static IRubyObject select_one(IRubyObject recv, IRubyObject[] args) {
         IRubyObject limit = rubyApi.getInstanceVariable(recv, &quot;@limit&quot;);
         if (limit == null || limit.isNil()) {
@@ -276,6 +271,7 @@ public class JdbcDerbySpec {
         }
     }
 
+    @JRubyMethod(name = &quot;add_limit_offset&quot;, required = 2)
     public static IRubyObject add_limit_offset(IRubyObject recv, IRubyObject sql, IRubyObject options) {
         IRubyObject limit = rubyApi.callMethod(options, &quot;[]&quot;, recv.getRuntime().newSymbol(&quot;limit&quot;));
         rubyApi.setInstanceVariable(recv, &quot;@limit&quot;,limit);
@@ -283,7 +279,8 @@ public class JdbcDerbySpec {
         return rubyApi.setInstanceVariable(recv, &quot;@offset&quot;,offset);
     }
 
-    public static IRubyObject _execute(IRubyObject recv, IRubyObject[] args) throws SQLException, java.io.IOException {
+    @JRubyMethod(name = &quot;_execute&quot;, required = 1, optional = 1)
+    public static IRubyObject _execute(ThreadContext context, IRubyObject recv, IRubyObject[] args) throws SQLException, java.io.IOException {
         Ruby runtime = recv.getRuntime();
         try {
             IRubyObject conn = rubyApi.getInstanceVariable(recv, &quot;@connection&quot;);
@@ -302,11 +299,11 @@ public class JdbcDerbySpec {
                 IRubyObject range;
                 IRubyObject max;
                 if (limit == null || limit.isNil() || RubyNumeric.fix2int(limit) == -1) {
-                    range = RubyRange.newRange(runtime, offset, runtime.newFixnum(-1), false);
+                    range = RubyRange.newRange(runtime, context, offset, runtime.newFixnum(-1), false);
                     max = RubyFixnum.zero(runtime);
                 } else {
                     IRubyObject v1 = rubyApi.callMethod(offset, &quot;+&quot;, limit);
-                    range = RubyRange.newRange(runtime, offset, v1, true);
+                    range = RubyRange.newRange(runtime, context, offset, v1, true);
                     max = rubyApi.callMethod(v1, &quot;+&quot;, RubyFixnum.one(runtime));
                 }
                 IRubyObject result = JdbcAdapterInternalService.execute_query(conn, new IRubyObject[]{args[0], max});</diff>
      <filename>src/java/jdbc_adapter/JdbcDerbySpec.java</filename>
    </modified>
    <modified>
      <diff>@@ -28,16 +28,14 @@ import org.jruby.Ruby;
 import org.jruby.RubyModule;
 import org.jruby.RubyString;
 
-import org.jruby.runtime.CallbackFactory;
+import org.jruby.anno.JRubyMethod;
 import org.jruby.runtime.builtin.IRubyObject;
 
 import org.jruby.util.ByteList;
 
 public class JdbcMySQLSpec {
-    public static void load(Ruby runtime, RubyModule jdbcSpec) {
-        RubyModule mysql = jdbcSpec.defineModuleUnder(&quot;MySQL&quot;);
-        CallbackFactory cf = runtime.callbackFactory(JdbcMySQLSpec.class);
-        mysql.defineFastMethod(&quot;quote_string&quot;,cf.getFastSingletonMethod(&quot;quote_string&quot;,IRubyObject.class));
+    public static void load(RubyModule jdbcSpec) {
+        jdbcSpec.defineModuleUnder(&quot;MySQL&quot;);
     }
 
     private final static ByteList ZERO = new ByteList(new byte[]{'\\','0'});
@@ -48,6 +46,7 @@ public class JdbcMySQLSpec {
     private final static ByteList SINGLE = new ByteList(new byte[]{'\\','\''});
     private final static ByteList ESCAPE = new ByteList(new byte[]{'\\','\\'});
 
+    @JRubyMethod(name = &quot;quote_string&quot;, required = 1)
     public static IRubyObject quote_string(IRubyObject recv, IRubyObject string) {
         ByteList bl = ((RubyString) string).getByteList();
         ByteList blNew = new ByteList();</diff>
      <filename>src/java/jdbc_adapter/JdbcMySQLSpec.java</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>LICENSE</filename>
    </removed>
    <removed>
      <filename>pom.xml</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0804f2341200333ab23c40eb20f33aac54455b21</id>
    </parent>
  </parents>
  <author>
    <name>nicksieger</name>
    <email>nicksieger@8ba958d5-0c1a-0410-94a6-a65dfc1b28a6</email>
  </author>
  <url>http://github.com/nicksieger/activerecord-jdbc-adapter/commit/83b4201ef0cec1f7ade3858cbe21c9fc6d649bd5</url>
  <id>83b4201ef0cec1f7ade3858cbe21c9fc6d649bd5</id>
  <committed-date>2008-03-07T21:15:12-08:00</committed-date>
  <authored-date>2008-03-07T21:15:12-08:00</authored-date>
  <message>- Moving to annotation-based method definition
- Catching up w/ thread context change
- Bumping version up to 0.8


git-svn-id: svn+ssh://rubyforge.org/var/svn/jruby-extras/trunk/activerecord-jdbc@931 8ba958d5-0c1a-0410-94a6-a65dfc1b28a6</message>
  <tree>5aae98136e84f6df45a78f9c2bf153261753d966</tree>
  <committer>
    <name>nicksieger</name>
    <email>nicksieger@8ba958d5-0c1a-0410-94a6-a65dfc1b28a6</email>
  </committer>
</commit>
