| 1 30 31 32 package org.hsqldb.jdbc; 33 34 import java.math.BigDecimal ; 35 import java.sql.CallableStatement ; 36 import java.sql.Date ; 37 import java.sql.Time ; 38 import java.sql.Timestamp ; 39 import java.sql.SQLException ; 40 import java.util.Calendar ; 41 42 import java.sql.Array ; 44 import java.sql.Blob ; 45 import java.sql.Clob ; 46 import java.sql.Ref ; 47 import java.util.Map ; 48 49 import org.hsqldb.HsqlException; 51 import org.hsqldb.Trace; 52 import org.hsqldb.lib.IntValueHashMap; 53 54 72 295 public class jdbcCallableStatement extends jdbcPreparedStatement 296 implements CallableStatement { 297 298 299 private IntValueHashMap parameterNameMap; 300 301 302 303 305 315 public jdbcCallableStatement(jdbcConnection c, String sql, 316 int type) 317 throws HsqlException, SQLException { 318 319 super(c, sql, type); 320 321 String [] names; 322 String name; 323 324 parameterNameMap = new IntValueHashMap(); 326 327 if (pmdDescriptor != null && pmdDescriptor.metaData != null) { 328 names = pmdDescriptor.metaData.colNames; 329 330 for (int i = 0; i < names.length; i++) { 331 name = names[i]; 332 333 if (name == null || name.length() == 0) { 335 continue; } 337 338 parameterNameMap.put(name, i); 339 } 340 } 341 } 342 343 351 int findParameterIndex(String parameterName) throws SQLException { 352 353 checkClosed(); 354 355 int index = parameterNameMap.get(parameterName, -1); 356 357 if (index >= 0) { 358 return index + 1; 359 } 360 361 throw Util.sqlException(Trace.COLUMN_NOT_FOUND, parameterName); 362 } 363 364 370 public void close() throws SQLException { 371 372 if (isClosed()) { 373 return; 374 } 375 376 parameterNameMap = null; 378 379 super.close(); 380 } 381 382 388 private void checkGetParameterIndex(int i) throws SQLException { 389 390 checkClosed(); 391 392 if (i < 1 || i > parameterModes.length) { 393 String msg = "Parameter index out of bounds: " + i; 394 395 throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg); 396 } 397 414 } 415 416 423 441 442 444 481 public void registerOutParameter(int parameterIndex, 482 int sqlType) throws SQLException { 483 throw Util.notSupported(); 484 } 485 486 520 public void registerOutParameter(int parameterIndex, int sqlType, 521 int scale) throws SQLException { 522 registerOutParameter(parameterIndex, sqlType); 523 } 524 525 547 public boolean wasNull() throws SQLException { 548 throw Util.notSupported(); 549 } 550 551 582 public String getString(int parameterIndex) throws SQLException { 583 throw Util.notSupported(); 584 } 585 586 609 public boolean getBoolean(int parameterIndex) throws SQLException { 610 throw Util.notSupported(); 611 } 612 613 636 public byte getByte(int parameterIndex) throws SQLException { 637 throw Util.notSupported(); 638 } 639 640 663 public short getShort(int parameterIndex) throws SQLException { 664 throw Util.notSupported(); 665 } 666 667 690 public int getInt(int parameterIndex) throws SQLException { 691 throw Util.notSupported(); 692 } 693 694 717 public long getLong(int parameterIndex) throws SQLException { 718 throw Util.notSupported(); 719 } 720 721 744 public float getFloat(int parameterIndex) throws SQLException { 745 throw Util.notSupported(); 746 } 747 748 771 public double getDouble(int parameterIndex) throws SQLException { 772 throw Util.notSupported(); 773 } 774 775 802 803 public BigDecimal getBigDecimal(int parameterIndex, 805 int scale) throws SQLException { 806 throw Util.notSupported(); 807 } 808 809 811 834 public byte[] getBytes(int parameterIndex) throws SQLException { 835 throw Util.notSupported(); 836 } 837 838 860 public Date getDate(int parameterIndex) throws SQLException { 861 throw Util.notSupported(); 862 } 863 864 887 public Time getTime(int parameterIndex) throws SQLException { 888 throw Util.notSupported(); 889 } 890 891 914 public Timestamp getTimestamp(int parameterIndex) throws SQLException { 915 throw Util.notSupported(); 916 } 917 918 947 public Object getObject(int parameterIndex) throws SQLException { 948 throw Util.notSupported(); 949 } 950 951 953 979 public BigDecimal getBigDecimal(int parameterIndex) throws SQLException { 980 throw Util.notSupported(); 981 } 982 983 1014 public Object getObject(int parameterIndex, Map map) throws SQLException { 1015 throw Util.notSupported(); 1016 } 1017 1018 |