1 16 17 package org.springframework.jdbc.core; 18 19 import java.util.LinkedList ; 20 import java.util.List ; 21 22 32 public class SqlParameter { 33 34 private final String name; 35 36 37 private final int sqlType; 38 39 40 private final String typeName; 41 42 43 47 public SqlParameter(int sqlType) { 48 this(null, sqlType, null); 49 } 50 51 56 public SqlParameter(int sqlType, String typeName) { 57 this(null, sqlType, typeName); 58 } 59 60 65 public SqlParameter(String name, int sqlType) { 66 this(name, sqlType, (String ) null); 67 } 68 69 75 public SqlParameter(String name, int sqlType, String typeName) { 76 this.name = name; 77 this.sqlType = sqlType; 78 this.typeName = typeName; 79 } 80 81 82 85 public String getName() { 86 return this.name; 87 } 88 89 92 public int getSqlType() { 93 return this.sqlType; 94 } 95 96 99 public String getTypeName() { 100 return this.typeName; 101 } 102 103 104 108 public static List sqlTypesToAnonymousParameterList(int[] types) { 109 List result = new LinkedList (); 110 if (types != null) { 111 for (int i = 0; i < types.length; i++) { 112 result.add(new SqlParameter(types[i])); 113 } 114 } 115 return result; 116 } 117 118 } 119 | Popular Tags |