一个很简单的SQL语句的问题 需要用到动态SQL语句,具体得看你用哪个数据库了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sql="select * from "+ x + "" String sql="select * from "+x+""; 而且变量也不是这么写的吧,sql="select * from "+X;才符合JAVA语法呀 sql="select * from "+ x + "" 都试了还是不行啊部分代码如下:con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.168:1521:horac","scott","tiger");stmt = con.createStatement();String strSql="drop table "+tableName+""; //换成 String strSql="drop table "+ tableName;也是一样r = stmt.executeQuery(strSql);System.out.println("Table dropped");出现以下错误提示:simplesqlserver.java:85: variable tableName might not have been initialized 提示的错误是说:tableName没有初始化,你没有给tableName赋值,当然会报错了 同意楼上variable tableName might not have been initialized变量 tableName 没有初始化~~ 同意 baffling(迷茫困惑中)的观点。我认为搂主是个高手,居然用ue编写java,连个ide也不用。如果用ec或者jb的话可能就不会出现这种问题了。 求解这句话是什么意思,和错误 怎么给她幸福? 如何刷新textarea中的内容? .db是什么文件,用什么可以打开呢? 请问怎么做键盘响应呀?看见大家问的问题这么高级,真是不好意思问这种弱智问题呀, 请高人帮忙!!! [求助]jtable中的combobox动态更新总是延迟一步, 高手请进! JAVA 中的接口到底是什么东东 ? 请各位指教 怎样用JAVA函数读写注册表,有这样的函数吗 jbuilder5的序列号? 一个网上通用的打印程序debug????????????????? 如何将Vector类型存入数据库,从数据库取出后又还原为Vector型?
部分代码如下:
con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.168:1521:horac","scott","tiger");
stmt = con.createStatement();
String strSql="drop table "+tableName+""; //换成 String strSql="drop table "+ tableName;也是一样
r = stmt.executeQuery(strSql);
System.out.println("Table dropped");出现以下错误提示:
simplesqlserver.java:85: variable tableName might not have been initialized
variable tableName might not have been initialized
变量 tableName
没有初始化~~
我认为搂主是个高手,居然用ue编写java,
连个ide也不用。如果用ec或者jb的话可能就不会出现这种问题了。