今天发现了这个错误

java.sql.SQLException: The SQL statement must not be null or empty.

并且看了些网页:综合说下这个错误。

一般都是我这种原因:

在executeQuery之前,我System.out.printf 你的sql,原来是空串。

只要这样if 下就轻松解决了

java.sql.SQLException: The SQL statement must not be null or empty.这个错误的更多相关文章

  1. MySQL案例04:Cause: java.sql.SQLException: Could not retrieve transaction read-only status from server

    今天同事发现程序日志有异常抛出,询问原因,进过排查发现与java的连接参数有关系,具体处理过程如下: 一.错误信息 "message": "\n### Error upd ...

  2. Caused by:java.sql.SQLException:ORA-00923

    1.错误描述 Caused by:java.sql.SQLException:ORA-00923:未找到要求的FROM关键字 2.错误原因 拼接SQL语句时缺少FROM什么表,导致出错 3.解决办法 ...

  3. Caused by:java.sql.SQLException:ORA-01008:并不是全部变量都已绑定

    1.错误描写叙述 Caused by:java.sql.SQLException:ORA-01008:并不是全部变量都已绑定 2.错误原因 3.解决的方法

  4. HiveServer2 的jdbc方式创建udf的修改(add jar 最好不要使用),否则会造成异常: java.sql.SQLException: Error while processing statement: null

    自从Hive0.13.0开始,使用HiveServer2 的jdbc方式创建udf的临时函数的方法由: ADD JAR ${HiveUDFJarPath} create TEMPORARY funct ...

  5. java.sql.SQLException: Prepared or callable statement has more than 2000 parameter markers及解决方案

    1. 问题 最近在项目中修bug的时候,碰到这样一个错误: Caused by: java.sql.SQLException:Prepared or callable statement has mo ...

  6. java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

    执行Hive查询: Console是这样报错的 java.sql.SQLException: Error from org.apache.hadoop.hive.ql.exec.mr.MapRedTa ...

  7. Oracle java.sql.SQLException: 数字溢出

    六月 30, 2016 5:47:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinit ...

  8. java.sql.SQLException: 对只转发结果集的无效操作: last

    出错代码如下:static String u = "user";static String p = "psw";static String url = &quo ...

  9. Hive报错之java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value

    在创建表的时候报出如下错误: hive> create table if not exists testfile_table( > site string, > url string ...

随机推荐

  1. ThinkPhp5 出现访问出现 No input file specified. 问题

    今天复习一下ThinkPhp5,在官网下载了核心版,windows下配置了虚拟域名之后出现了神奇的现象 如下图 直接访问域名能访问到index模块下的index控制器下的index方法 但是我输入完整 ...

  2. Java:ConcurrentLinkedQueue的实现原理分析

    本文是作者原创,首发于InfoQ:http://www.infoq.com/cn/articles/ConcurrentLinkedQueue 1.    引言 在并发编程中我们有时候需要使用线程安全 ...

  3. JavaScript深拷贝

    1,JSON.parse(JSON.stringify(obj)) 使用JSON实现深拷贝必须要求对象是符合JSON安全的,不了解JSON安全的自行百度. 2,lodash/underscore  _ ...

  4. Qt打包发布exe

    1.首先以 release 方式编译源代码,然后将生成的a. exe 程序放到一个单独的文件夹中. 2.再从开始菜单打开 Qt 命令行工具. 3.在命令行中,进入到第一步中a. exe 程序所在的文件 ...

  5. Unity打包提示UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.错误

    不要将打包的输出路径设置为Assets文件夹下面即可,MD真坑 老外给出的解释: As you have noticed after you click build settings you are ...

  6. Ubuntu18.04安装Guake下拉式终端

    Guake的优势是方便,可以很迅速的唤起与隐藏,已经成为我所需终端的主力. 安装方式:sudo apt-get install guake bug修复:使用时输入exit命令会导致终端卡死系统报错,同 ...

  7. 前台js接收后台的json数据

    后台返回的json数据,如php的: return json_encode($data); 在前台 js接收如下: function json2object(str){ var jsstr = str ...

  8. win7 ssh linux虚拟机(ubuntu12.04)

    环境: 1. 管理vmware Workstation8.0 2. Ubuntu 12.04.iso安装文件 3.Ssh登录软件putty 步骤 1.安装,安装linux系统时,在“硬件”里设置“网络 ...

  9. android 界面设计

    wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); DisplayMetrics dm = new DisplayMetric ...

  10. .net framework 4.5 +steeltoe+ springcloud(二) 实现服务发现与调用功能

    首先,写一个简单的可被调用的服务注册到服务中心,我们这命名为java-service,用的是IDEA创建一个spring boot项目,选择spring client类型. 修改application ...