admin 管理员组文章数量: 887083
2024年1月17日发(作者:microsoft sql server2012)
try {n(strsql);PreparedStatement pstmt = eStatement(strsql);eQuery();ResultSetMetaData rsmd = aData();int size = umnCount(); // 共有多少列colnames = new String[size];colTypes = new String[size];colSizes = new int[size];colScale = new int[size];for (int i = 0; i < umnCount(); i++) {alogName(i + 1);colnames[i] = umnName(i + 1).toLowerCase();colTypes[i] = umnTypeName(i + 1).toLowerCase();colScale[i] = le(i + 1);n(alogName(i + 1));if ("datetime".equals(colTypes[i])) {importUtil = true;}if ("image".equals(colTypes[i]) || "text".equals(colTypes[i])) {importSql = true;}if (colScale[i] > 0) {importMath = true;}colSizes[i] = cision(i + 1);}String content = parse(colnames, colTypes, colSizes);try {FileWriter fw = new FileWriter(initcap(tablename) + ".java");PrintWriter pw = new PrintWriter(fw);n(content);();();
** @param sb*/private void processAllMethod(StringBuffer sb) {for (int i = 0; i < ; i++) {("tpublic void set"+ initcap(colnames[i])+ "("+ oracleSqlType2JavaType(colTypes[i], colScale[i],colSizes[i]) + " " + colnames[i] + "){rn");("ttthis." + colnames[i] + "=" + colnames[i] + ";rn");("t}rn");("tpublic "+ oracleSqlType2JavaType(colTypes[i], colScale[i],colSizes[i]) + " get" + initcap(colnames[i])+ "(){rn");("ttreturn " + colnames[i] + ";rn");("t}rn");}}/*** 解析输出属性** @return*/private void processAllAttrs(StringBuffer sb) {("tprivate static final long serialVersionUID = 1L;rn");for (int i = 0; i < ; i++) {("tprivate "+ oracleSqlType2JavaType(colTypes[i], colScale[i],colSizes[i]) + " " + colnames[i] + ";rn");}("rn");}
} catch (SQLException e) {tackTrace();}conn = null;}}/*** @param args*/public static void main(String[] args) {GenerateJavaFileUtils t = new GenerateJavaFileUtils();oEntity("users");}}
版权声明:本文标题:在线mysql转bean_数据库表转换成javaBean对象小工具 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1705426311h484316.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论