mybatis执行sql异常,实在找不出问题出在哪了! 5C

配置文件



















映射文件


select * from USERINFO where USERNAME=#{username} and PWD=#{pwd}


映射接口
public interface UserInfoMaper {
public UserInfoBean selectuser(UserInfoBean userInfoBean);
}

实体类
public class UserInfoBean {
private String name;
private String username;
private String pwd;

public UserInfoBean(String name, String username, String pwd) {
    this.name = name;
    this.username = username;
    this.pwd = pwd;
}

public UserInfoBean() {

}

public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getUsername() {
    return username;
}
public void setUsername(String username) {
    this.username = username;
}
public String getPwd() {
    return pwd;
}
public void setPwd(String pwd) {
    this.pwd = pwd;
}

}
测试类
public class MainTest {
private static UserInfoBean userentity;
public static void main(String[] args) {
SqlSession sqlSession = MybatisUtil.getSqlSession();
System.out.println(sqlSession);
UserInfoBean userInfoBean = new UserInfoBean();
userInfoBean.setUsername("admin");
userInfoBean.setPwd("123456");
UserInfoMaper userInfoMaper = sqlSession.getMapper(UserInfoMaper.class);
userentity =userInfoMaper.selectuser(userInfoBean);
}
}
当执行到userInfoMaper.selectuser(userInfoBean)异常
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: oracle.jdbc.OracleDriver

The error may exist in SQLMaper.xml

The error may involve org.great.maper.UserInfoMaper.selectuser

The error occurred while executing a query

Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: oracle.jdbc.OracleDriver

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
at com.sun.proxy.$Proxy0.selectuser(Unknown Source)
at org.great.main.MainTest.main(MainTest.java:17)

Caused by: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: oracle.jdbc.OracleDriver
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.initializeDriver(UnpooledDataSource.java:211)
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:190)
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:186)
at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:88)
at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:373)
at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:82)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:131)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:58)
at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:271)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:69)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
... 6 more

8个回答

异常已经很明显了,jdbc配置错误,driverClassName=oracle.jdbc.driver.OracleDriver,不是oracle.jdbc.OracleDriver

这应该是mybatis的一个bug,编译错误,没有报异常抛出来。

重新编译一遍,在编译之前 先把配置文件里变量大小写统一

Cannot find class: oracle.jdbc.OracleDriver ,先查看jdbc配置

缺少oracle.jdbc.OracleDriver这个jar包

缺少jdbc驱动jar包

这个是报的是数据库驱动包的异常信息,不是sql映射问题,可以先检查一下,数据库配置信息是否正确,执行一遍,不行的话,重新编译一下,或重新导入数据库驱动包再试试

你的驱动配置文件应该出错了 去检查配置文件

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
MVC页面跳转,实在找不到问题出在哪。
前端:rn[code=html] 用户名rn 密码rn rn 登录rn [/code]rn脚本:rn[code=javascript] [/code]rn后台:rn[code=csharp] public class LoginController : Controllerrn rn public ActionResult Index()rn rnrn return View();rn rn public ActionResult Check()rn rn return Redirect("../Publish/Index");rn rn [/code]rn调试的时候会执行Publish/Index且Firebug查看响应正常,就是页面不刷新。求指点,不胜感激。
总是出先“附近出错”,找不出在哪。
[img=https://img-bbs.csdn.net/upload/201410/28/1414481655_43768.jpg][/img]rnrnrn上面出现的错误是什么意思,理解不了。帮帮解决一下,谢谢。
实在找不出错误在哪里?
这是一个data.cpprn在main.cpp使用extern 使用这些数据,rn[code=C/C++]#include "glhelper.h"rnfloat item1[14][2] =rn rn 32.598f,120.498f,rn 32.597f,120.524f,rn 32.590f,120.560f,rn 32.575f,120.641f,rn 32.571f,120.696f,rn 32.570f,120.735f,rn 32.572f,120.757f,rn 32.577f,120.785f,rn 32.581f,120.808f,rn 32.593f,120.832f,rn 32.605f,120.864f,rn 32.612f,120.874f,rn 32.617f,120.879f,rn 32.617f,120.896frn;rnfloat item2[24][2] =rn rn 32.633f,120.698f,rn 32.598f,120.698f,rn 32.571f,120.697f,rn 32.570f,120.735f,rn 32.572f,120.757f,rn 32.577f,120.785f,rn 32.581f,120.808f,rn 32.589f,120.828f,rn 32.565f,120.841f,rn 32.555f,120.848f,rn 32.540f,120.851f,rn 32.512f,120.854f,rn 32.464f,120.855f,rn 32.446f,120.853f,rn 32.422f,120.853f,rn 32.402f,120.850f,rn 32.382f,120.843f,rn 32.349f,120.846f,rn 32.337f,120.850f,rn 32.300f,120.872f,rn 32.274f,120.877f,rn 32.258f,120.873f,rn 32.216f,120.883f,rn 32.190f,120.890frn;rnfloat item3[13][2] =rnrn 32.448f,120.544f,rn 32.440f,120.609f,rn 32.437f,120.665f,rn 32.434f,120.697f,rn 32.437f,120.745f,rn 32.449f,120.795f,rn 32.463f,120.841f,rn 32.464f,120.858f,rn 32.464f,120.883f,rn 32.465f,120.895f,rn 32.467f,120.903f,rn 32.495f,120.954f,rn 32.512f,120.988frn;rnrnfloat item4[24][2] =rn rn 32.5222f,120.5380f,rn 32.5211f,120.5545f,rn 32.5193f,120.5727f,rn 32.5196f,120.5952f,rn 32.5184f,120.6028f,rn 32.5152f,120.6198f,rn 32.5146f,120.6366f,rn 32.5141f,120.6494f,rn 32.5118f,120.6566f,rn 32.5107f,120.6735f,rn 32.5134f,120.6791f,rn 32.5132f,120.7071f,rn 32.5128f,120.7609f,rn 32.5088f,120.8268f,rn 32.5078f,120.8390f,rn 32.5180f,120.8806f,rn 32.5201f,120.8937f,rn 32.5154f,120.9233f,rn 32.5093f,120.9398f,rn 32.5080f,120.9575f,rn 32.5110f,120.9662f,rn 32.5128f,120.9886f,rn 32.5319f,121.0f,rn 32.5676f,121.022frn;[/code]rnrnrnVS2008 报错如下: rnrn1>------ 已启动生成: 项目: editor, 配置: Release Win32 ------rn1>正在编译...rn1>data.cpprn1>.\data.cpp(21) : error C2146: 语法错误 : 缺少“”(在标识符“,120”的前面)rn1>.\data.cpp(21) : error C2146: 语法错误 : 缺少“”(在标识符“,120”的前面)rn1>.\data.cpp(21) : error C2146: 语法错误 : 缺少“;”(在标识符“,120”的前面)rn1>.\data.cpp(21) : error C2143: 语法错误 : 缺少“;”(在“常量”的前面)rn1>.\data.cpp(21) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 intrn1>.\data.cpp(21) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(21) : error C2059: 语法错误 : “”rn1>.\data.cpp(22) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(22) : error C2447: “”: 缺少函数标题(是否是老式的形式表?)rn1>.\data.cpp(23) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(24) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(25) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(26) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(27) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(28) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(29) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(30) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(31) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(32) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(33) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(34) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(35) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(36) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(37) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(38) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(39) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(40) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(41) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(42) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(43) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(44) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(45) : error C2059: 语法错误 : “”rn1>.\data.cpp(45) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(45) : error C2059: 语法错误 : “”rn1>.\data.cpp(48) : error C2146: 语法错误 : 缺少“”(在标识符“,120”的前面)rn1>.\data.cpp(48) : error C2146: 语法错误 : 缺少“”(在标识符“,120”的前面)rn1>.\data.cpp(48) : error C2146: 语法错误 : 缺少“;”(在标识符“,120”的前面)rn1>.\data.cpp(48) : error C2143: 语法错误 : 缺少“;”(在“常量”的前面)rn1>.\data.cpp(48) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 intrn1>.\data.cpp(48) : error C2086: “int ,120”: 重定义rn1> .\data.cpp(21) : 参见“,120”的声明rn1>.\data.cpp(48) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(48) : error C2059: 语法错误 : “”rn1>.\data.cpp(49) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(49) : error C2447: “”: 缺少函数标题(是否是老式的形式表?)rn1>.\data.cpp(50) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(51) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(52) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(53) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(54) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(55) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(56) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(57) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(58) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(59) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(60) : error C2470: “,”: 看起来像函数定义,但没有参数列表;跳过明显的函数体rn1>.\data.cpp(61) : error C2059: 语法错误 : “”rn1>.\data.cpp(61) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(61) : error C2059: 语法错误 : “”rn1>.\data.cpp(64) : error C2143: 语法错误 : 缺少“;”(在“”的前面)rn1>.\data.cpp(64) : error C2447: “”: 缺少函数标题(是否是老式的形式表?)rn1>.\data.cpp(90) : fatal error C1004: 发现意外的文件尾rn1>生成日志保存在“file://g:\OpenGL\editor\Release\BuildLog.htm”rn1>editor - 61 个错误,0 个警告rn========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
实在找不出错误的原因,,^_^
程序很简单,,是定义十个分数,从中找出各个阶段的数,,但我返回就会出错 rnrndate segmentrna db 76,69,84,90,73,88,99,63,100,80rns6 db 0 ;60~69rns7 db 0rns8 db 0rns9 db 0rns10 db 0rncrlf db 13,10,'$'rnrndate endsrnrncode segmentrnmain proc farrnassume cs:code,ds:daternrnstart:rnmov ax,daternmov ds,axrncall sortrnrnmov cx,5rnlea si,s6rngo_on:rnmov dl,ds:[si]rnadd dl,30hrnmov ah,02hrnint 21hrnlea dx,crlfrnmov ah,09hrnint 21hrninc sirnloop go_onrnrnrnmov ax,4c00hrnint 21hrnrnmain endprnrnrnsort proc nearrnrnmov dx,10rnlea si,arnmov cx,10rnnext:rncmp byte ptr [si],69rnjbe add_s6rncmp byte ptr [si],79rnjbe add_s7rncmp byte ptr [si],89rnjbe add_s8rncmp byte ptr [si],99rnjbe add_s9rnjmp add_s10rnrnadd_s6:rninc s6rndec dxrncmp dx,0rnjb exitrninc sirnjmp nextrnrnadd_s7:rninc s7rndec dxrncmp dx,0rnjb exitrninc sirnjmp nextrnrnadd_s8:rninc s8rndec dxrncmp dx,0rnjb exitrninc sirnjmp nextrnrnadd_s9:rninc s9rndec dxrncmp dx,0rnjb exitrninc sirnjmp nextrnrnadd_s10:rninc s10rndec dxrncmp dx,0rnjb exit rninc sirnjmp nextrnexit: rn retrnsort endprnrncode endsrnend startrn rnrnrnrnrnrn
请教一个简单的程序,我实在找不出错误在哪了!
我在阅读《C语言入门经典》的第4章的书中例子4.06时,自己写的代码和书的差别不大,但是执行时scanf("%c",&answer);这一句不执行,会被跳过,但我对了一下书上的代码,也是一样的,不知道怎么回事?rn我自己的代码如下:rn#include rn#include rnint main(void)rnrn char answer=0;rn double total=0.0;rn double value=0.0;rn int count=0;rn rn printf("\nThis program calculates the average of any number of values.");rn rn for(;;)rn rn printf("\nEnter a value:");rn scanf("%lf",&value);rn total+=value;rn ++count;rn rn printf("\nDo you want to enter another value?(Y or N):");rn scanf("%c",&answer);rn rn if(tolower(answer)=='n')rn break;rn rn printf("The average is %.2lf\n",total/count);rn return 0;rnrnrnrn书中代码如下:rn#include rn#include /* For tolower() function */rnrnint main(void)rnrn char answer = 'N'; /* Records yes or no to continue the loop */rn double total = 0.0; /* Total of values entered */rn double value = 0.0; /* Value entered */rn int count = 0; /* Number of values entered */rnrn printf("\nThis program calculates the average of"rn " any number of values.");rnrn for( ;; ) /* Indefinite loop */rn rn printf ("\nEnter a value: "); /* Prompt for the next value */rn scanf(" %lf", &value); /* Read the next value */rn total += value; /* Add value to total */rn ++count; /* Increment count of values */rnrn /* check for more input */rn printf("Do you want to enter another value? (Y or N): ");rn scanf(" %c", &answer ); /* Read response Y or N */rnrn if( tolower(answer) == 'n' ) /* look for any sign of no */rn break; /* Exit from the loop */rn rn /* output the average to 2 decimal places */rn printf ("\nThe average is %.2lf\n", total/count );rn return 0;rnrn[img=https://img-bbs.csdn.net/upload/201504/30/1430391975_320498.png][/img]
二叉堆,老是WA,请问错误在哪,我实在找不出~
http://acm.dlut.edu.cn/problem.php?id=1081rnDescriptionrnrn 三国演义有记载,新野一战,刘备以少胜多打败曹操,曹操引五十万大军前来报仇。刘备的三千人马走到当阳县,突然被曹兵截住,战到天明才摆脱曹兵的追赶,护卫刘备家小的赵云发现不见了刘备,走散了糜夫人母子,急集合三十骑,又杀回乱军中寻找。赵云在一位大嫂的指引下,在一截断墙后面的枯井旁找到糜夫人母子。糜夫人说:"见到将军阿斗有救了,……我死而无恨!"说完,趁赵云不注意跳井身亡。这时曹兵向这边杀来,赵云含泪推倒土墙埋了夫人,急忙抱起阿斗往外冲。曹将杀来,战三回合,被赵云杀死。赵云力战众将,威武勇猛。正在山上观战的曹操见赵云势不可挡,传令一定要活捉。赵云利用这个机会冲出包围,连杀50员曹将,终于将阿斗交给了刘备。rnrn赵云单骑救主的故事广为流传。话说赵云有一招绝技,没有人能够在绝技下幸存。赵云救到刘禅后,要突出重围。已知赵云一共遇到了n名敌人,每个敌人有一个攻击力,每个敌人的攻击力各不相同,且最大为n。为了减轻自己的压力,赵云每次会选择当前幸存的攻击力最大的敌人并将其杀死。n名敌人会依次过来增援,一次来一个,并且都围在赵云周围(即来了之后赵云都可以攻击到),现在给出敌人的增援序列和赵云使用绝技的时间,请依次给出死亡敌人的攻击力。rnrnInputrnrn 第一个整数为case(case<=10)数。对于每个case,一定以整数n(n<=100000)开头,表示对应的敌人总数。下一行n个整数依次表示增援敌人的攻击力。下一行一个整数,表示赵云使用绝技的次数q(q<=n),接下来一行q个整数(由小到大),qi表示赵云在第qi个敌人来了之后使用了一次绝技。rnrnOutputrnrn 依次输出死亡敌人的攻击力,每两个整数之间一个空格,每个case结尾有个换行。rnrnSample Inputrnrn2rn5 rn1 2 3 4 5rn2rn2 5rn4rn1 2 3 4rn1rn4rnSample Outputrnrn2 5rn4rn[code=C/C++]# includern# includernrnint heap[100001],b[100001],all=0;rnrnvoid insert(int x)rnrn heap[all] = x;rn all++;rn int s,p = all-1,t;rn while(p>0)rn rn s = (p-1)/2;rn if(heap[s]=heap[i]) break;rn t = heap[s];rn heap[s] = heap[i];rn heap[i] = t;rn s = i;rn rnrnrnint main()rnrn int n,i,t,x,q,j;rn scanf("%d",&t);rn while(t--)rn rn all = 0;rn scanf("%d",&n);rn for(i=0;i
大家帮忙看下,实在找不出错在哪,空指针异常问题
大家帮忙看下:下面这段代码当选择设备时,能正常显示结果,但选择教室时,结果也能显示出来,却多出一句异常报告,请大家指点!rn<%@page contentType="text/html;charset=gb2312"%>rn<%@page import="java.sql.*"%>rn<%@page import="java.util.*"%>rn<%@page import="java.text.*"%>rnrnrn 普通用户rn rnrn<%rnObject o = session.getAttribute("uname"); rnif(o==null)rnrn response.sendRedirect("login.jsp"); rnrn%>rn rn rn rn rn 实验室设备管理系统rn rn rn rn rn rn rn 设备查询/预订rn 教室查询/预订rn 使用信息rn 预订处理rn 修改密码rn 注销[退出]rn rn rn rn<%rnString ddate=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());%>rn当前日期:<%=ddate%>rn rn rn rn rn 用户名:rn 使用类别:rnrn==设备==rn==教室==rnrnrn rnrnrnrn<%rnString name=request.getParameter("name");rnString sel=request.getParameter("sel");rnif((name==null)&&(sel==null))rnrnrnelsern rn name=new String(name.getBytes("ISO8859-1"));rn sel=new String(sel.getBytes("ISO8859-1"));rn tryrn rn Class.forName("com.mysql.jdbc.Driver");rn Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/device","root","123456");rn Statement stmt=conn.createStatement();rn String sql="";rn if("设备".equals(sel))rn rn %>rn rn rn 设备号rn 类别rn 教室编号rn 用户rn 借出时间rn 归还时间rn rn <%rn sql="select * from lend where lname='"+name+"'";rn ResultSet rs=stmt.executeQuery(sql);rn if(rs.next())rn rnrn rs.previous();rn while(rs.next())rn rn String devno=new String (rs.getString("devno").getBytes("GB2312"));rn String devclass=new String (rs.getString("devclass").getBytes("GB2312"));rn String labno=new String (rs.getString("labno").getBytes("GB2312"));rn String lname=new String (rs.getString("lname").getBytes("GB2312"));rn String ltime=new String (rs.getString("ltime").getBytes("GB2312"));rn String etime=new String (rs.getString("etime").getBytes("GB2312"));%>rn rn <%=devno%>rn <%=devclass%>rn <%=labno%>rn <%=lname%>rn <%=ltime%>rn <%=etime%>rn <%rn rn %> <%rn rn rn elsern rn out.println("没有数据!");rn rn rs.close();stmt.close();rn rn elsern rn if("教室".equals(sel))rn rn %>rn rn rn 教室编号rn 类别rn 设备数量rn 用户rn 借出时间rn 归还时间rn rn <%rn sql="select * from lendlab where lname='"+name+"'";rn ResultSet rs=stmt.executeQuery(sql);rn if(rs.next())rn rn rs.previous();rn while(rs.next())rn rn String labno=new String (rs.getString("labno").getBytes("GB2312"));rn String labclass=new String (rs.getString("labclass").getBytes("GB2312"));rn String devcount=new String (rs.getString("devcount").getBytes("GB2312"));rn String lname=new String (rs.getString("lname").getBytes("GB2312"));rn String ltime=new String (rs.getString("ltime").getBytes("GB2312"));rn String etime=new String (rs.getString("etime").getBytes("GB2312"));%>rn rn <%=labno%>rn <%=labclass%>rn <%=devcount%>rn <%=lname%>rn <%=ltime%>rn <%=etime%>rn <%rn rn %> <%rn rn rn elsern rn out.println("没有数据!");rn rn rs.close();stmt.close();rnrn rn rn conn.close();rn rn catch(Exception e)rn rn out.println(e);rn rnrn%>rn
请专家帮帮忙吧,小弟实在找不出错在哪了。
专家大哥,你好rn我把整个工程上传了,文件要求的最后的输出结果在out.txt中rn可是我的就是不对啊 ,我看了下,就能看出来是条件判断的时候不正确,没跳进循环里面rn所以那个number没加上,rn可是我不知道是哪错了啊rn请专家指点下rn十分感谢
WriteableBitmap类 问题 个人实在搞不定,不知问题出在哪了
我模仿深蓝一个WPF剪切图片的方法 使用WriteableBitmap类rn部分源码:rnvoid bi1_ImageOpened(object sender, RoutedEventArgs e)rn rn img2.Source = sender as BitmapImage;rn rn writeableBitmap.Render(img2, null);rn writeableBitmap.Invalidate();rn this.img.Source = writeableBitmap;rn EquipPart(Equipment, 8, 34, 150, 150);rnrn this.img11.Source = PartImage[0, 1][0, 0];rn rn此时this.img.Source = writeableBitmap;rn正常显示rn下来开始剪切图片:EquipPart方法rn public ImageSource[,] EquipPart(int[] Equipment, int rowNum, int colNum, int singleWidth, int singleHeight)rn rnrn ImageSource[,] bitmap = new ImageSource[rowNum, colNum];rnrn WriteableBitmap wb1 = new WriteableBitmap(singleWidth, singleHeight);rn for (int i = 0; i < rowNum; i++)rn rnrn for (int j = 0; j < colNum; j++)rn rn wb1.Render(this.img, new TranslateTransform() X = -1 * rowNum * singleWidth, Y = -1 * rowNum * singleHeight );rn wb1.Invalidate();rn bitmap[i, j] =(ImageSource) wb1;rnrnrn rnrn rnrn return bitmap;rnrn此时this.img11.Source = PartImage[0, 1][0, 0];rn不能正常显示 实在不知道问题出在哪了rn往大家帮帮忙。。。
高手帮忙,实在找不出原因
Extjs的combox组件没有办法加载数据rn代码如下:rnvar deptselect = new Ext.data.Store(rn reader:new Ext.data.JsonReader(rn root:'root',rn fields:['id','name']rn ),rn proxy:new Ext.data.HttpProxy(rn url:'fbinfo.do?method=initDeptCombo'rn )rn);rnrnvar formpanel = Ext.create('InfoFB_FormPanel',rn layout:'form',rn labelWidth:80,rn labelAlign :'right',rn items:[rn layout:'column',rn frame:true,rn items:[rn xtype:'combo',rn id:'fbdept_id',rn name:'fbdept',rn hiddenName:'sub_fbdept', rn columnWidth:.6,rn allowBlank:false,rn fieldLabel:'反馈科室',rn emptyText:'--请选择--',rn store:deptselect,rn mode:'remote',rn loadingText:'loading',rn displayField:'name',rn valueField:'id',rn forceSelection:true,rn typeAhead:truern ]rn);rnrnvar infofbForm = function()rn var infofbWin = Ext.create('hosp.view.InfoFB',rn modal:true,rn resizable :false,rn constrain:true,rn closeAction:'hide',rn items:formpanelrn );rn infofbWin.show();rn;rnaction部分:rnpublic ActionForward initDeptCombo(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response)rn throws Exception rn response.setContentType("text/html;charset=utf-8"); rn PrintWriter out = null;rn BrowseSvr bssvr = null;rn String json = "";rn tryrn bssvr = new BrowseSvrImp();rn json = bssvr.initDeptCombo();rn out = response.getWriter();rn out.write(json); //json值:"root":["id":"500","name":"网络管理科"]rn System.out.println(json);rn catch(MyException e)rn throw new MyException("初始化加载部门信息失败!");rn rn out.flush();rn out.close();rnrn return null;rn rnjson值:"root":["id":"500","name":"网络管理科"]
python 运行实在找不出错误
[img=https://img-bbs.csdn.net/upload/201805/08/1525753670_870936.png][/img]rn求大佬解答
Mybatis异常-SQL执行没反应,但oracle单独执行正常
运行环境SpringBoot表现结果1、有的SQL能够执行,有的SQL不行,运行也不报错,但就是执行后没有效果。 2、但SQL单独再oracle中是执行成功的。SQL片段<select id="checkDaohangProcessedStatusByRefid" parameterType="Map" resultType="java.lang.Integer"> SELECT
递归出了问题,但是实在找不出,help
#includern#includernrnconst int N=11; rnconst int mod=9973;rnrnrnvoid matrix_mult(int a[][N],int b[][N],int c[][N])//a[0][1]存放矩阵行数,a[1][0]存放列数 rnrn int i,j,k;rn for(i=1;i<=a[0][1];i++)rn for(j=1;j<=b[1][0];j++)rn rn c[i][j]=0;rn for(k=1;k<=a[1][0];k++) rn c[i][j]+=(a[i][k]*b[k][j])%mod;rn c[i][j] %= mod; rn rn c[0][1]=a[0][1];rn c[1][0]=b[1][0];rnrnvoid m_y(int a[][N],int b[][N],long k)//计算a^b%crnrn int c1[N][N];rn if(k==2) matrix_mult(a,a,b);rn rn else if(k%2==0)rn rn m_y(a,b,k/2);rn for(int i=1;i<=b[0][1];i++)rn for(int j=1;j<=b[1][0];j++)rn c1[i][j]=b[i][j];rn c1[0][1]=b[0][1];rn c1[1][0]=b[1][0];rn matrix_mult(c1,c1,b);rn rn else m_y(a,b,k-1);rn for(int i=0;i<=b[0][1];i++)rn for(int j=0;j<=b[1][0];j++)rn c1[i][j]=b[i][j];rn matrix_mult(c1,a,b);rn rnrnrnrnint main()rnrn int t,n;rn long k;rn rn int sum=0;rn rn int a[N][N],b[N][N];rn scanf("%d",&t);rn while(t--)rn rn scanf("%d %ld",&n,&k);rnrn for(int i=1;i<=n;i++)rn rn for(int j=1;j<=n;j++)rn scanf("%d",&a[i][j]);rnrn rn a[0][1]=n;rn a[1][0]=n;rn m_y(a,b,k);rn rn for(int i=1;i<=b[1][0];i++)rn sum+=b[i][i];rn printf("%d\n",sum%mod);rn for(int i=0;i
帮我看看----------------实在找不出那里有问题!
为什么这个单选按钮实现不了我要的的呢?rn选了一个以后其它再按就没有用了!????rnrnimport java.awt.*;rnimport java.applet.Applet;rnimport java.awt.event.*;rnrnpublic class TextCheckboxgr extends Applet implements ItemListenerrnrn CheckboxGroup style;rn Checkbox p,b,i;rn Button btn;rn public void init()rn rn style=new CheckboxGroup();rn p=new Checkbox("PLAIN",true,style);rn b=new Checkbox("BOLD",false,style);rn i=new Checkbox("ITALIC",false,style);rn btn=new Button("EFFECT");rn add(p);rn add(b);rn add(i);rn add(btn);rn p.addItemListener(this);rn b.addItemListener(this);rn i.addItemListener(this);rn rn rn public void itemStateChanged(ItemEvent e)rn rn Checkbox temp;rn Font oldF=btn.getFont();rn if(e.getItemSelectable() instanceof Checkbox)rn rn temp=(Checkbox)(e.getItemSelectable());rn if(temp.getLabel()=="PLAIN");rn btn.setFont(new Font(oldF.getName(),Font.PLAIN,12));rn if(temp.getLabel()=="BOLD");rn btn.setFont(new Font(oldF.getName(),Font.BOLD,13));rn if(temp.getLabel()=="ITALIC");rn btn.setFont(new Font(oldF.getName(),Font.ITALIC,14)); rn rn rn
HTML5+CSS问题,找了半天实在找不出错
本来这个页面已经写好了,很正常的,然后我写其他页面改了下CSS,就出问题了,我训着记忆改了回去,这个页面就这样了,找了一晚上找不出来问题,求大神帮忙看一下rn[code=html]rnrnrnrn rn XXX的个人信息rn rn rnrnrn rn rn OA协同办公系统rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn XXX的个人信息rn rn 员工号:rn 姓名:rn rn rn 性别:rn 年龄:rn rn rn 所属部门:rn 职位:rn rn rn 兴趣爱好:rn 移动电话:rn rn rn 电子邮件:rn 固定电话:rn rn rn 系统角色:rn 密码:rn rn rn rn rn 个人介绍:rn rn rn rnrn rn rnrnrn[/code]
mybatis执行sql报错问题
mybatis执行sql报错,the SQL execution time is too large, please optimize !sql如下:rnSELECT statt1.edu1 education ,statt1.count1 thirtyDown,statt2.count2 thirtyUp FROM (SELECT fm1.education edu1,COUNT(fm1.id) count1 FROM sys_family_member fm1 WHERE fm1.education <> '' AND fm1.age <= 30 GROUP BY fm1.education) statt1rn LEFT JOIN (SELECT fm1.education edu2,COUNT(fm1.id) count2 FROM sys_family_member fm1 WHERE fm1.education <> '' AND fm1.age >30 GROUP BY fm1.education) statt2rn ON statt1.edu1 = statt2.edu2rn和rnSELECT fm.healthyStatus,COUNT(id) amount FROM sys_family_member fm GROUP BY fm.healthyStatus;
C 的走迷宫问题 实在找不出问题所在了。。。
mice.txt文件内容n24 24 1 1 24 1 n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0n1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0nn-------------------------------------------------------------------n(感觉是search的问题 但找不出问题)nn#include n#includenint V=0;nnint xnum;nint ynum;nint a[100][100];nntypedef structnn int x;n int y;nNODE;ntypedef structnn NODE nownode;n NODE prenode;n int dir;nGRID;nNODE start;nNODE end;nGRID grid;nnnvoid Init()nnn FILE *fp;n fp=fopen("mice.txt","r");n fscanf(fp,"%d%d%d%d%d%d",&xnum,&ynum,&start.x,&start.y,&end.x,&end.y);//24 24 1 1 24 1n int i,j;n for(j=0;j<=ynum+1;j++)n for(i=0;i<=xnum+1;i++)n a[j][i]=1;n for(j=1;j<=ynum;j++)n for(i=1;i<=xnum;i++)n fscanf(fp,"%d",&a[j][i]);n //grid.nownode.x =start.x;n //grid.nownode.y=start.y; n grid.nownode=start;n fclose(fp);n nnnnnvoid search(int x,int y)n n if((x==24)&&(y==1))n V=1;n elsen a[x][y]=1;n if((V==0)&&(a[x][y+1]==0)) //向右查找----------v==0 可避免在V==1时的不必要搜索 第一个if里的可略 n search(x,y+1);n if((V==0)&&(a[x+1][y]==0))//向下查找n search(x+1,y);n if((V==0)&&(a[x][y-1]==0)) //向左查找n search(x,y-1);n if((V==0)&&(a[x-1][y]==0)) //向上查找n search(x-1,y); n n a[x][y]=0;n if(V=1)n a[x][y]=2;n nnnnint main()nn int x,y;n Init();n x=grid.nownode.x;n y=grid.nownode.y;n printf("%d %d\n",start.x,start.y);n printf("%d %d %d \n",a[24][1],a[24][0],a[25][1]);n printf("%d \n",V);n search(x,y);nn for(int i=0;i<=xnum+1;i++) nnfor(int j=0;j<=ynum+1;j++) nprintf("%d",a[i][j]);nprintf("\n");nn n scanf("%d",&x);n return 0;n n
帮我看看这个问题出在哪 实在找不出来
[code=JScript]rn rn[/code]rnrn [code=VBScript]rn<% if 1=1 then %>rn rn <% end if %>rn[/code]rn这样写怎么老是跳出错误? rn x.style.display="block";这行
实在不知道错在哪的问题
大侠我想在htm页面上选中复选框提交后显示aaaaa,不选中复选框提交后显示bbbb,代码如下:rn rnrn rnrnrnrntest.asp文件内容rn<%rndim aaarnaaa=request.form("aaa")rnresponse.write aaarn%>rn我试了一上午,选中后可以显示"aaaa",但不选中后总也不显示'bbbb',麻烦大侠指教
问题出在哪?????
我在NT4下用InterDev建立了一个项目,项目中有中文名子目录,也有图片,在NT4下rn工作正常,但我把它拷到Win2000 Advanced Server中,浏览是图片显示不了,并且rn无法访问那些用中文命名的子目录下的页面。rn问题出在哪?
这段问题出在哪?
rn private const string seldc = "dbo.seldc";rn public DataSet dbdc(SqlParameter par)rn rn mycon = cf.conn();rn cf.Open();rn myds = new DataSet();rn mycmd = new SqlCommand(seldc,mycon);rn mycmd.CommandType= CommandType.StoredProcedure;rn myda.SelectCommand = mycmd;rn rn myda.SelectCommand.Parameters.Add(par);rn myda.Fill(myds);rn return myds;rnrn rn为什么提示说myda.SelectCommand = mycmd;这行未将对象引用到事例?
问题出在哪?
g_pView->SendMessage(WM_USERAPPLY, m_iPage);rn当m_iPage=0时成功,而非零时,报Access Violation错?错误在哪?
请问问题出在哪?
F:\Tomcat\webapps\ROOT下有个Hi.class和Hi.htm文件,rn浏缆器中输入:http://loccalhost:8080/Hi.htmrn我点击提交按钮后居然什么也没有?请问我是哪里错了?rnservlet的代码如下:rnimport java.io.*;rnimport javax.servlet.http.*;rnimport javax.servlet.*;rnpublic class Hi extends HttpServletrnrn public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletExceptionrn rn res.setContentType("text/html");rn PrintWriter out=res.getWriter();rn out.println("");rn out.println("");rn out.println("");rn out.println(" Hello,you");rn out.println("");rn out.println(" Hello,you");rn out.println("");rn out.println("");rn rnrn它生成个Hi.class,Hi.htm代码如下:rnrnrn rn rn rn New Page 1rnrnrn rnrn rnrnrnrnrn
请教问题出在哪
location.href='login.php';";rnrnif($_POST[user]=='admin')rn $pw=md5($_POST[pw]);rn if($pw=='e1bfd762321e409cee4ac0b6e841963c')rn setcookie('cookie','ok');rn echo " ";rn rn include("head.php");rn if($_COOKIE['cookie']!='ok')rn?>rn rnrn rn ID: rn PW: rnrn rn rn rn 退出rn rnrnrnrnrnParse error: syntax error, unexpected $end in D:\wamp\www\bbs\login.php on line 56rnrnrnrn
不知道问题出在哪?
#include rn#include rn#include rn#include rnrnusing namespace std;rnusing std::string;rnusing std::vector;rnusing std::list;rnrnint main()rnrnrn list slist;rn slist.push_back('a');rn slist.push_back('b');rn slist.push_back('c');rnrn vector vect(slist.begin(),slist.end());rn vector::iterator iter = vect.begin();rn while(iter != vect.end())rn rn cout<<*iter++<
这个问题出在哪?
[code=HTML][/code]rn得出的结果为rn[code=HTML]rn[/code]rn就是多个加号 请问怎么解决谢谢
问题出在哪呢?
我写的一个CODE,我有思路,但是写的时候却总出错,请大家帮忙指点rnrn问题是"sees looks smells tastes likes"rn提取里面的smell。 我的思路是先提取smell 往后的字母(smells tastes likes)再提取smell。rn第一步,我遇到了问题。怎么也找不出smell之前的那个空格的位置。请大家帮忙看看rnrnpublic class A4P1rnrn public static void main(String agrs[])rnrn String words="sees looks smells tastes likes";rn String letters="abcdefghijklmnopqrstuvwxyz";rnrn int k,x=0;rn int i=0;rn while(x!=2)rn for(int j=0; j
问题出在哪!!!!!!
下面这段代码,SMTP服务器总是返回如下错误代码:rn451: Mail data invalid, ignored. The sender in mailbody is "AqYHeng" while MAIL FROM is "AqYHeng@ah163.com"rn500: Syntax error, command unrecognizedrnrn不知究竟错在哪里,望不吝赐教!!!!!!rnrnstrDate = Format(Date, "Ddd") & ", " & Format(Date, "dd Mmm YYYY") & " " & Format(Time, "hh:mm:ss") & "" & " +0800"rn rn strHeadData = "From:" & Chr(32) & Mid(TxtFrom.Text, 1, InStr(1, TxtFrom.Text, "@") - 1) & vbCrLf & _rn "Date:" & Chr(32) & strDate & vbCrLf & _rn "X-Mailer: Cyclone Email Express v1.0" & vbCrLf & _rn "To:" & Chr(32) & Mid(TxtTo.Text, 1, InStr(1, TxtTo.Text, "@") - 1) & vbCrLf & _rn "Subject:" & Chr(32) & TxtSubject.Text & vbCrLfrn rn WsockSMTP.SendData strHeadData & vbCrLfrnrn WsockSMTP.SendData TxtContent.Text & vbCrLfrn rn WsockSMTP.SendData vbCrLf & "." & vbCrLf
Sprintf 问题出在哪
[code=C/C++]rn#include "stdio.h"rnrnvoid main()rn rn long int i;rn char * sql="";rn for(i=1000000;i<1000010;i++)rn rn sprintf(sql,"select * from person where urid=%ld",i);rn printf("%s\n",sql);rn rnrn[/code]
请问问题出在哪?
我在一个webform中的button1的click中加入如下代码rn想将ACCess中的一个表gzk导成一个xls文件rnAccess.ApplicationClass kk = new Access.ApplicationClass() ;rn rn kk.OpenCurrentDatabase("d:\\db1.mdb",false) ;rn rn kk.DoCmd.TransferSpreadsheet(Access.AcDataTransferType.acExport,Access.AcSpreadSheetType.acSpreadsheetTypeExcel8,"gzk","d:\\mygood.xls",true,null,true) ;rnrn但提示的是“拒绝访问”!请问我要如何设置用户名和口令?
怒了,问题出在哪?
在页面载入的时候,把焦点设在一个TEXTBOX上。rn我试了rndocument.getelementbyid('textbox1').focusrn还有rndocument.all.Textbox1.focusrn都不行,说“为空或不是对象”rn这是什么意思?应该怎么改?
问题出在哪
公司通过ddn到日本总部实现邮件收发,有那么几天时间,日本ddn端口显示我们公司过去大量数据,占满了通道,导致邮件不正常,电信查线路正常,估计问题出在我们公司内部,是公司ddn设备问题,还是内部有病毒一类的可能性大.
进来看看这个SQL问题出在哪?
rn[code=SQL]rndeclare @i nvarchar(16)rndeclare @j nvarchar(16)rnrnset @i ='1'rnset @j ='int'rnrnselect case @j rn when 'datetime' then cast(@i as datetime)rn when 'nvarchar' then cast(@i as nvarchar(16)) rn when 'int' then cast(@i as int)rnendrnrn[/code]rn执行结果:rn1900-01-02 00:00:00.000rn————————————rn为什么不是返回1?
帮忙看看这段sql问题出在哪?
sqlString ="DECLARE @CN NVARCHAR(100)"rn +" IF EXISTS (select serialnumber from TravelRoutingWorkStationMaterial where DateCodeSN = '" + serail + "' )"rn + " BEGIN "rn + " select @CN = serialnumber from TravelRoutingWorkStationMaterial where DateCodeSN ='" + serail + "'"rnrn + " set '" + serail + "'=@CN"rn + " END";rn DataSet dataset = QueryDataSet(sqlString);rn return serail;
不知道问题出在哪
在oracle中表里一字段为varchar2(100)里面存储的内容为一段话,其中有回车换行的,但用rs.getString取出来后放在javaBean中的String 类型 的属性中,再让这个值给jsp 页面中html元素rn标记的value,显示后却没有了回车换行,问题出在哪?
请教,问题出在哪
我在连接数据库时出现了以下这个错误rnERROR:rnORA-12560: TNS: 协议适配器错误
看看问题出在哪?
// .hrnrn int a;rn float b;rn struct crn rn AnsiString d;rn int gg;rn bool e;rn struct frn rn int g;rn AnsiString j;rnrn aa[12];rnrn cc;rnrn// .cpprnvoid __fastcall TForm1::Button1Click(TObject *Sender)rnrn int handel;rn struct c bb[5];rn bb[0].d = "wqwrqwr";rn bb[0].e = True;rn bb[0].aa[0].j = "fds";rn bb[0].aa[11].j = "sadsd";rn bb[0].gg = 7984;rn //......rn bb[4].d = "dfd";rn bb[4].e = false;rn bb[4].aa[0].j = "s";rn bb[4].aa[11].j = "dfs";rnrn handel = FileCreate("c:\\data");rn FileWrite(handel,bb,sizeof(c)*5);rn FileClose(handel);rnrn//---------------------------------------------------------------------------rnvoid __fastcall TForm1::Button2Click(TObject *Sender)rnrn int handel;rn struct c bb[5];rn handel = FileOpen("c:\\data",fmOpenRead);rn FileRead(handel,bb,sizeof(c)*5);rn FileClose(handel);rn Edit1->Text = bb[0].gg;rn Edit2->Text = bb[0].d;rnrnrn为什么从文件中读出后,只要是AnsiString 类型的都不对啊!谢谢!rn
问题出在哪...?
[code=Java]int len = Integer.parseInt(String.valueOf(this.getFileLength()));//end - beginrnSystem.out.println("int Len:"+len);rn// 保存每个线程读取的数据rnbyte b[] = new byte[len];rnSystem.out.println("b="+b);[/code]rnrn[color=#FF0000]当执行到byte b[] = new byte[len];时抛出java.lang.reflect.InvocationTargetExceptionrn导致内存溢出java.lang.OutOfMemoryError: Java heap space[/color]rnrn而int Len已打印出来为54095475是一个51.5M文件,小于50M就可以.rn大于50M就出此问题!rnrn请问,这是为什么?有什么解决办法吗?急......
问题出在哪?谢谢!
Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As LongrnrnPrivate Sub Command1_Click()rnDim i As Integerrni = WinExec("notepad.exe", "c:\wst.txt", 9)rnIf i > 32 ThenrnMsgBox "调用下确!!"rnElsernMsgBox "调用错误!!"rnEnd IfrnrnEnd Sub
问题出在哪呢?
function remindDel(aaa) rn var isDel = confirm("您确定要删除这条信息吗?"); rn if(isDel) rn alert(aaa); rn document.getElementById(aaa).click(); rn alert(document.getElementById(aaa).id); rn else rn return; rn rn rn ')"> rn rn " style="display:none" href="..."> rn rn rnrn也就是说我以 来做id值,可这样触发不了 ,就是不跳转,函数里的alert都是正常的(值也一样). rn当我把两个 换成常量时(如下),就能触发 使页面跳转,但这样做是处理不了载后的多数据项的问题. rn rn rn rn rn rn rnrn所以我想问题就出现在javascript,html和struts标签之间的影响上,可出现在哪呢? rnrn这个问题看似简单却整了我快两天了,可急死我了
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件