java.sql.SQLException: Parameter metadata not available for the given statement
来源:互联网 发布:程序员试用期总结 编辑:程序博客网 时间:2024/06/10 00:16
static void readMeta(String sql, Object[] params) throws SQLException { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { conn = DBConnectionManager.getConnection(); ps = conn.prepareStatement(sql); ParameterMetaData pmd=ps.getParameterMetaData(); int count=pmd.getParameterCount(); for(int i=1;i<=count;i++){ System.out.print(pmd.getParameterClassName(i)+" "); System.out.print(pmd.getParameterMode(i)+" "); System.out.print(pmd.getParameterType(i)+" "); System.out.println(pmd.getParameterTypeName(i)); } } finally { DBConnectionManager.free(rs, ps, conn); } }
获取元数据时出错:java.sql.SQLException: Parameter metadata not available for the given statement
将登陆数据库时的链接更改一下就可以了,原来
private static final String DB_URL = "jdbc:mysql://localhost:3306/test";
改为
private static final String DB_URL = "jdbc:mysql://localhost:3306/test?generateSimpleParameterMetadata=true";
0 0
- SQL java.sql.SQLException: Parameter metadata not available for the given statement
- java.sql.SQLException: Parameter metadata not available for the given statement
- java.sql.SQLException: Parameter metadata not available for the given statement
- SQLException: Parameter metadata not available for the given statement
- SQLException:Parameter metadata not available for the given statement
- java.sql.SQLException: Parameter metadata not available for the given sta
- Parameter metadata not available for the given statement
- java.sql.SQLException: Statement parameter 1 not set.问题的解决
- ocp 047-141 Evaluate the following SQL statement:SELECT product_name || 'it's not available for orde
- java.sql.SQLException: No value specified for parameter 16
- mybatis TypeHandler java.sql.SQLException: No value specified for parameter
- java.sql.SQLException: !Statement.GeneratedKeysNotRequested!
- 解决java.sql.SQLException: Parameter number X is not an OUT parameter
- 解决java.sql.SQLException: Parameter number X is not an OUT parameter
- java.sql.SQLException: Parameter number 4 is not an OUT parameter
- java.sql.SQLException: Parameter number X is not an OUT parameter
- Mabatis报错 java.sql.SQLException: Parameter number 3 is not an OUT parameter 解决方法
- java.sql.SQLException: Userdoes not have access to metadata required to determine stored procedurepa
- 那些年,在nodejs上踩过的坑(一)
- Linux中替换文本中的字符串
- 439 - Knight Moves
- HDU 5298 Solid Geometry Homework(异或)
- iOS中使用七牛云存储Django服务端实现简单的图片上传功能
- java.sql.SQLException: Parameter metadata not available for the given statement
- C语言-变量的存储类别(auto, static, register, extern)
- Store Kit Guide(In App Purchase)翻译
- 暑假集训第四周阶段一 DP A - Robberies
- opencv——PNG格式图像读取转换函数
- C++第七节:继承
- 斐波那契数列四吧
- Codeforces 520D. Cubes 状态模拟+贪心
- vidibility属性visible,invisible与gone的区别