Topic: 这个程序哪里错了呀,大哥帮忙呀.(ODBC MetaData) |
Print this page |
1.这个程序哪里错了呀,大哥帮忙呀.(ODBC MetaData) | Copy to clipboard |
Posted by: kkk Posted on: 2005-12-30 09:29
String cname=results.getString("COLUMN_NAME");这是一个错误, dumpResults("--jia--");//显示表名.这里也有一个错误. 我建一个数据库,一个表名为jia 数据源名也为jia.里面有三个变量.name,sex,age. 不知为什么老错呀. |
2.Re:这个程序哪里错了(ODBC MetaData) [Re: kkk] | Copy to clipboard |
Posted by: why Posted on: 2006-01-02 22:30 请尽量使用准确的文字描述作为标题 (甚至只是简单的错误信息) 若新帖再無恰当标题,可能会被刪除 原來的标题: 这个程序哪里错了呀,大哥帮忙呀. Please read your code carefully and check the syntax errors first. > String cname=results.getString("COLUMN_NAME");这是一个错误, while(result.next()) String cname should be declared outside the while block, and it is suggested to use curly brackets even for single statement. > dumpResults("--jia--");//显示表名.这里也有一个错误. Where is this dumpResults(String) defined? What are you trying to do in the catch block with this mess? catch(Exception e) { Statement smt=con.createStatement(); result=stmt.executeQuery("select name form jia;"); } > String query="select distinctrow name from jia"+"where(Name like c%);"; distinctrow is not standard SQL syntax, are you using M$ Access? |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |