Advertisement
Guest User

Array Implementation

a guest
Apr 5th, 2011
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package dictionary.test;
  6.  
  7. import java.sql.ResultSet;
  8. import java.sql.SQLException;
  9. import java.util.Map;
  10.  
  11. /**
  12. *
  13. * @author Daron
  14. */
  15. public class PreparedStatementArray implements java.sql.Array {
  16.  
  17. int[] ints;
  18. String baseTypeName, toString;
  19.  
  20. public PreparedStatementArray(int[] ints) {
  21. StringBuilder toStringBuilder;
  22.  
  23. this.ints = ints;
  24. baseTypeName = "INTEGER";
  25. toStringBuilder = new StringBuilder("{\"");
  26. for (int index = 0; index < ints.length - 1; index++) {
  27. toStringBuilder.append(ints[index] + ", ");
  28. }
  29. toStringBuilder.append(ints[ints.length - 1] + "}");
  30. toString = toStringBuilder.toString();
  31. }
  32.  
  33. public String getBaseTypeName() throws SQLException {
  34. return baseTypeName;
  35. }
  36.  
  37. public int getBaseType() throws SQLException {
  38. return java.sql.Types.INTEGER;
  39. }
  40.  
  41. public Object getArray() throws SQLException {
  42. throw new UnsupportedOperationException("Not supported yet.");
  43. }
  44.  
  45. public Object getArray(Map<String, Class<?>> map) throws SQLException {
  46. throw new UnsupportedOperationException("Not supported yet.");
  47. }
  48.  
  49. public Object getArray(long index, int count) throws SQLException {
  50. throw new UnsupportedOperationException("Not supported yet.");
  51. }
  52.  
  53. public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
  54. throw new UnsupportedOperationException("Not supported yet.");
  55. }
  56.  
  57. public ResultSet getResultSet() throws SQLException {
  58. throw new UnsupportedOperationException("Not supported yet.");
  59. }
  60.  
  61. public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
  62. throw new UnsupportedOperationException("Not supported yet.");
  63. }
  64.  
  65. public ResultSet getResultSet(long index, int count) throws SQLException {
  66. throw new UnsupportedOperationException("Not supported yet.");
  67. }
  68.  
  69. public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
  70. throw new UnsupportedOperationException("Not supported yet.");
  71. }
  72.  
  73. public void free() throws SQLException {
  74. throw new UnsupportedOperationException("Not supported yet.");
  75. }
  76.  
  77. @Override
  78. public String toString() {
  79. return toString();
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement