jdbc连接MySQL报错, 有没有大神帮忙解决一下

代码

报错如下:
图片说明

这是日志:
rizhi

小白用JDBC连接MySQL数据库, 向数据表里面插入数据, 报错, 大神可不可以帮忙看看

2个回答

双引号错误,删掉多余的双引号

request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");

请求和响应 的转码是不一样的 你试下这个

qq_40723748
九成宫醴泉铭 回复qq_42988868: 我就是测试一下......
10 个月之前 回复
qq_42988868
Control desire 还有 你为啥要在jsp里面写这些
10 个月之前 回复
qq_42988868
Control desire 回复qq_40723748: 你SQLyog的 账号和密码 是 username 和 password 吗? 还有 value 里面的 引号不能那么用 连着会把括号去掉的
10 个月之前 回复
qq_40723748
九成宫醴泉铭 不是啊, 我不是说乱码. 我是说向数据库插入数据失败
10 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
有没有大神帮忙解决一下
下面的代码为什么会出现异常rnimport java.awt.*;rnimport javax.swing.*;rnrnpublic class yhdl extends JFramern JPanel mb1,mb2,mb3;rn JButton an1,an2;rn JLabel bq1,bq2;rn JTextField wbk;rn JPasswordField mmk;rn rn public static void main(String[] args) rn yhdl a=new yhdl();rn rn rn yhdl()rn mb1=new JPanel();rn mb2=new JPanel();rn mb3=new JPanel();rn bq1=new JLabel("用户名");rn bq2=new JLabel("密 码");rn an1=new JButton("登录");rn an2=new JButton("取消");rn wbk=new JTextField(10);rn mmk=new JPasswordField(10);rn rn this.setLayout(new GridLayout(3,2));rn rn mb1.add(bq1); mb1.add(wbk);rn mb2.add(bq2); mb2.add(mmk);rn mb3.add(an1); mb3.add(an2);rn rn this.add(mb1); this.add(mb2); this.add(mb3);rn rn this.setTitle("用户登录");rn this.setSize(230,150);rn this.setLocation(500,500);rn this.setResizable(false);rn this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn this.setVisible(true);rn rn rn rnrnrnrn异常代码rnException in thread "main" java.lang.StackOverflowErrorrn at java.awt.Insets.(Unknown Source)rn at sun.awt.windows.WToolkit.getScreenInsets(Native Method)rn at sun.awt.windows.WToolkit.getScreenInsets(Unknown Source)rn at java.awt.Window.init(Unknown Source)rn at java.awt.Window.(Unknown Source)rn at java.awt.Frame.(Unknown Source)rn at java.awt.Frame.(Unknown Source)rn at javax.swing.JFrame.(Unknown Source)rn at JPanel.(JPanel.java:12)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn at JPanel.(JPanel.java:13)rn
JDBC连接MYSQL老是报错
package com.shake.database.dao;rnimport java.sql.DriverManager;rnimport java.sql.SQLException;rnimport java.sql.Connection;rnpublic class DataSource rnrn private static String driver = "com.mysql.jdbc.Driver";rn private static String url = "jdbc:mysql://localhost:3306/shake";rn private static String userName = "root";rn private static String passWord = "123456"; //密码rn /**rn * 获得数据库连接rn */rn //这里获取数据库的链接rn public static Connection getConnection()rn //加载驱动rn tryrn Class.forName(driver);rn //打开并返回数据库连接rn Connection connection = DriverManager.getConnection(url,userName,passWord);rn return connection;rn catch(ClassNotFoundException e)rn rn e.printStackTrace();rn catch(SQLException e)rn rn e.printStackTrace();rn rnrn return null;rn rnrnrnrnrn这是报错rn[color=#FF0000]java.sql.SQLExceptionrn at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)rn at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)rn at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)rn at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)rn at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)rn at org.apache.tomcat.jdbc.pool.ConnectionPool.(ConnectionPool.java:143)rn at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)rn at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)rn at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)rn at com.shake.database.dao.UserDao.queryUserList(UserDao.java:23)rn at com.shake.servlet.UserServlet.userIsExist(UserServlet.java:56)rn at com.shake.servlet.UserServlet.doPost(UserServlet.java:42)rn at com.shake.servlet.UserServlet.doGet(UserServlet.java:31)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnCaused by: java.lang.NullPointerExceptionrn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Unknown Source)rn at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)rn ... 30 morern[/color]rnrnrn求帮助
奇怪,帮忙解决一下mysql的连接问题
有两台主机,我的地址为:192.168.0.13rn另一台:192.168.0.15rn两台都有mysql3rn我用mysql front连接另一台提示:192.168.0.13 不允许连接192.168.0.15rn而另一台用mysql front可以连接我,操作rn这个问题该怎么解决?
请大神帮忙解决一下
请各位大神给出源程序,不胜感激!rnrn1.编写一个C++程序,计算并输出两个无符号大整数m与n的和、差、积、整商及余数(其中| m | ≤ 101000 ,| n | ≤ 101000)。用类来实现这个无符号大整数的和、差、积、整商及求余运算以及插入符(<<)和提取符(>> )的重载。rnrn2.编程求解皇后问题。在m*m的棋盘上有n个皇后(n ≤ m),输出所有合法的皇后排列(即在任何一行、一列或一条对角线上,仅能放置一个皇后)。rnrn3.实现图书馆借书系统,其功能包括:rn申请新的图书证;rn注销图书证;rn图书查询,方式包括按书名、作者、关键字查询等;rn借书(包括续借、预约);rn书到期后,发送还书的通知;rn还书(包括过期罚款);rn读者状态查询;rn读者个人信息修改(包括修改密码)。rnrn4.编写一个C++程序,它能根据读入的某二叉树的中序序列和后序序列(两个英文字母串,每个串长不大于80,各占一行),构造该二叉树,并输出该二叉树的前序序列、叶的个数、二度结点个数及其从根节点开始的最长路径上的各结点。rnrn5.编写一个C++程序,它能根据读入的某带权有向图G的边、权,来构造图G,并输出G的邻接矩阵、拓扑序列、各顶点之间的最短路经。输入时用三个非负整数i、j、w表示一条边(顶点Vi到顶点Vj的边)及该边的权(w);三个-1(-1 -1 -1) 表示输入结束。其中,i和j的值都不大于40,i、j值中最大者再加1是图G的顶点个数。
求大神帮忙解决一下
[img=https://img-bbs.csdn.net/upload/201408/28/1409228843_418446.png][/img]rn请问这个是什么原因出现的提示:如何让它取消掉?求大神解决,
jdbc连接的问题,大神们进来帮忙一下吧
最近在自学jdbc的相关知识,然后就遇到了下面的问题,就是jdbc连接数据库的时候出现了问题,具体如下:rn代码为:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400061934_903912.jpg][/img]rn然后就报错了,错误的截图是:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400061978_723530.jpg][/img]rn然后我就根据错误的提示到网上找了下,其中ip地址是正确的:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400062060_979595.jpg][/img]rn端口号也是正确的:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400062103_880201.jpg][/img]rn实例名也是正确的:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400062724_712025.jpg][/img]rn然后我的oracle的服务也开了:rn[img=https://img-bbs.csdn.net/upload/201405/14/1400062841_81030.jpg][/img]rn我也不知道问题出在哪里,请各位大神解决啊,感激不尽!rnrn
mysql 经常锁表 有没有大神帮忙分析一下???
[img=https://img-bbs.csdn.net/upload/201805/28/1527493176_333851.jpg][/img]
数据添加的时候报错~那位大神帮忙解决一下
org.springframework.dao.InvalidDataAccessResourceUsageException: could not insert: [com.train.pojo.TicketInfo]; SQL [insert into train.ticket_info (trainid, userid, username, trainnum, from, to, stringtype, sitetype, price, stime) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.train.pojo.TicketInfo]rn org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:629)rn org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)rn org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)rn org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)rn com.train.dao.impl.TicketInfoDAOImpl.doCreate(TicketInfoDAOImpl.java:19)rn com.train.dao.impl.TicketInfoDAOImpl.doCreate(TicketInfoDAOImpl.java:1)rn com.train.service.impl.TicketInfoServiceImpl.insert(TicketInfoServiceImpl.java:15)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn $Proxy7.insert(Unknown Source)rn com.train.action.TicketInfoAction.insert(TicketInfoAction.java:50)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrnrnrnorg.hibernate.exception.SQLGrammarException: could not insert: [com.train.pojo.TicketInfo]rnrnrncom.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax torn后台报错:rn10:48:43,875 WARN JDBCExceptionReporter:100 - SQL Error: 1064, SQLState: 42000rn10:48:43,890 ERROR JDBCExceptionReporter:101 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, to, stringtype, sitetype, price, stime) values (10, 1, '?ó??', 'T5302', '°' at line 1rnrn页面上的参数传递:rnrn <%--rn rn rn rn rn rn rn rn rn rn rn --%>rn <%--rn rn rn rn rn rn rn rn rn rn rn --%>
oracle插入数据时报错,跪求各位大神帮忙解决一下
问题是:在插入表数据时总是报某个字段有NULL值导致插入表失败,入表的SQL语句太长,我就简单的写下了rn insert into table1 (select 字段1,字段2,字段3 from table2 union select 字段1,字段2,字段3 from table3)rn16年1月1日前的数据还是正常的,但是之后这个语句就开始报错。因为table1表中字段全部不允许为空,报的错误是插入时有某个字段有NULL值存在,但是数据我查询了3天都没找到哪个字段有NULL值,并且我重新建了一张跟系统一模一样的表将查询到的数据直接导入到这张表中是正常的。那么问题来了,这个到底是那边的错误?rnrn跪求各位大神帮忙解决一下
orcl出问题,还请大神帮忙解决一下报错问题
orcl报错,有点蒙圈了[img=https://img-bbs.csdn.net/upload/201904/04/1554342692_779830.jpg][/img][img=https://img-bbs.csdn.net/upload/201904/04/1554342715_284362.jpg][/img]
CMake 编译 TrinityCore时报错请大神帮忙解决一下~
想自己搭建一个WOW私服下载的是 VS2015 下载完源码后 编译出现这个错误~在网上找了很多都解决不了希望哪位大神帮忙解决一下~谢谢好人一生平安~!
有没有大神帮忙精简一下,欢迎私信。
//在一个排好序的数组中间插入一个数 #include"stdio.h" int main() {  int i, n, c;  printf("please a n:");  scanf_s("%d", &n);  int arr[6] = { 1, 3, 4, 4, 7, 9 };  for (i = 0; i  {   if (i = 6)   {    for (
mysql 报错1005 请大神们帮忙解决下
[img=https://img-bbs.csdn.net/upload/201410/16/1413430452_846324.png][/img]
报错:java.sql.SQLException: 关闭的连接,大神帮忙看下
报错信息:rnrn[2014-10-17 13:19:50,655] [TF_OPEN_CEN1_BD1_$_TF_OPEN_INTERFACE_MSG_G_PROCESS] (DefaultTemplateImpl.java:173) ERROR com.ai.openframern.core.exe.tf.template.defaults.DefaultTemplateImpl - ITfTemplateImpl::finishIExecute errorrnjava.sql.SQLException: 关闭的连接rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)rn at oracle.sql.CLOB.getDBAccess(CLOB.java:1196)rn at oracle.sql.CLOB.getCharacterStream(CLOB.java:278)rn at com.asiainfo.zjoss.openframe.bo.BOIOpenInterfaceMsgBean.getOpenInterfaceMsgBean(BOIOpenInterfaceMsgBean.java:347)rn at com.asiainfo.zjoss.openframe.exe.IIOpenMsgExecTfJobImpl$TransfJobImpl._finishExecute(IIOpenMsgExecTfJobImpl.java:52)rn at com.ai.openframe.core.exe.tf.template.defaults.DefaultTemplateImpl$DefaultTransfJobImpl.finishExecute(DefaultTemplateImpl.java:3rn33)rn at com.ai.openframe.core.exe.tf.template.defaults.DefaultTemplateImpl$IITemplateExcutor._finishIExecute(DefaultTemplateImpl.java:16rn8)rn at com.ai.openframe.core.exe.tf.template.defaults.DefaultTemplateImpl._finishExecute(DefaultTemplateImpl.java:46)rn at com.ai.openframe.core.exe.tf.template.defaults.DefaultTemplateImpl.finishExecute(DefaultTemplateImpl.java:60)rn at com.ai.openframe.core.exe.tf.TfWorkframe$IITfScanJobQueue.run(TfWorkframe.java:354)rnrnrnrnrn方法:rnrnrn protected void _finishExecute(ITfScanJobIDefine aIScanJobItemSKEL, java.util.HashMap[] aISrcRecSKEL) throws IOpenException, Exception rn java.util.List aIDataLSKEL = new java.util.ArrayList();rn try rn String prodIns = DataFilter(aISrcRecSKEL);rn java.util.HashMap aMap = new java.util.HashMap();rn String strSql = sql + "("+prodIns.substring(0,prodIns.length()-1)+")";rn BOSfOrderBusiResRelateBean aBeans[] = OpenFactory.getIOpenInterfaceMsgSV().getSfOrderBusiResRelateBeans(strSql, aMap, 999999); rn java.util.HashMap aITaskCSKEL = new java.util.HashMap(); rn //java.util.Map aIDataLSKEL = new java.util.HashMap();rn for (int index = 0;index0)rn// for(IBOIOpenInterfaceMsgValue bean:beans)rn// if(bean.getMsgId()>aMsgBean.getMsgId())rn// aMsgBean.setState(IterfaceMessProcess.I_OPEN_INTERFACE_MSG_STATE_R);rn// aMsgBean.setCompleteDate(TimeUtils.IFuncIExcutor._getISysdate());rn// aIDataLSKEL.add((DataContainer)aMsgBean);rn// break;rn// rn// rn// if(aMsgBean.getState().equals(IterfaceMessProcess.I_OPEN_INTERFACE_MSG_STATE_R)) continue;rn// rn rn long orderId = IIOpenMsgExecTfJobImpl.getProcIns().Process(aISrcRecSKEL[index],aBeans);rn// String ProdTypeId = String.valueOf(aMsgBean.getProductTypeId());rn// //无线固话信控停开机直接置接口表状态为R rn// if(ProdTypeId.equals(ZJRmConst.WIRELESS_TEL))rn// aMsgBean.setOrderId(orderId);rn// aMsgBean.setState(IterfaceMessProcess.I_OPEN_INTERFACE_MSG_STATE_R);rn// aMsgBean.setCompleteDate(TimeUtils.IFuncIExcutor._getISysdate());rn// aIDataLSKEL.add((DataContainer)aMsgBean);rn// elsern aMsgBean.setOrderId(orderId);rn aMsgBean.setState(IterfaceMessProcess.I_OPEN_INTERFACE_MSG_STATE_S);rn aMsgBean.setCompleteDate(TimeUtils.IFuncIExcutor._getISysdate());rn aIDataLSKEL.add((DataContainer)aMsgBean);rn// rn catch(Exception e)rn aMsgBean.setState(IterfaceMessProcess.I_OPEN_INTERFACE_MSG_STATE_F);rn aMsgBean.setCompleteDate(TimeUtils.IFuncIExcutor._getISysdate());rn int end = e.toString().length();rn if(end > 800);end = 800;rn aMsgBean.setErrorMsg(StringUtil.substring(e.toString(), 0, end));rn aIDataLSKEL.add(aMsgBean);rn rn rn OpenFactory.getIOpenItfMsgSV().saveBatch(aIDataLSKEL);rn finallyrn if(aIDataLSKEL != null)aIDataLSKEL.clear();aIDataLSKEL = null;rn rn rn
mysql创建数据库报错,求大神帮忙看一下!!
rnrn创建数据库。要求用SQL语句创建满足如下要求的数据库:rn(1) 数据库名称为School;rn(2) 主数据文件:逻辑名为SchoolData,文件名为“D:\School\SchoolData.mdf”,文件初始大小为50MB,文件的最大大小不受限制,文件的增长率为20%。rn(3) 日志文件:逻辑名为SchoolLog,文件名为“D:\School\SchoolLog.ldf,”文件初始大小为10MB,文件的最大大小为50MB,文件的增长率为1MB;rnsql语句如下:rn[code=sql]create database Schoolrnon primaryrn(name='SchoolData',rnfilename='D:\School\SchoolData.mdf',rnsize=50MB,rnmaxsize=unlimited,rnfilegrowth=20%)rnrnlog on(rnname='SchoolLog',rnfilename='D:\School\SchoolLog.ldf',rnsize=10MB,rnmaxsize=50MB,rnfilegrowth=1MBrn)[/code]rnrn[img=https://img-bbs.csdn.net/upload/201610/27/1477558065_132584.png][/img]
ASP连接ACCESS报错,求大神解决
代码应该是没有错的,我是在网上下载的别人的 但是在我的电脑上打开就出现这个[img=https://img-bbs.csdn.net/upload/201605/26/1464262645_829459.png][/img]
JDBC连接sqlserver2005报错
报错信息:rn2009-3-19 7:20:51 com.microsoft.sqlserver.jdbc.AuthenticationJNI rn警告: Failed to load the sqljdbc_auth.dllrnrn网上说只要把sqljdbc_auth.dll放到system32目录下就可以了。。。 rnsqljdbc_auth.dll 去那里下载啊?
jdbc连接sqlserver2005,报错...
我已经启用了混合模式,加载了msbase.jar,mssqlserver.jar,msutil.jar,sqljdbc.jar这四个jar。rn测试代码:rnpublic static void main(String[] args) throws Exception rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rn String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";rn Connection conn = (Connection) DriverManager.getConnection(url,"sa","root"); rn String sql = "INSERT INTO user (id ,name, password) VALUES (1,'test', 'test')"; rn Statement stmt = (Statement) conn.prepareStatement(sql); rn stmt.executeUpdate(sql);rn conn.close(); // 关闭数据库连接rn stmt.close();rn rnrn[color=#FF0000]报错:rnException in thread "main" java.lang.ClassCastException: com.microsoft.jdbc.sqlserver.SQLServerConnection cannot be cast to com.mysql.jdbc.Connection[/color]rn求解???
jdbc连接Oracle报错
import java.sql.*;rnrnpublic class TestJDBC rnrn public static void main(String[] args) throws Exception rn Class.forName("oracle.jdbc.driver.OracleDriver");rn Connection conn = DriverManager.getConnection("jdbc:Oracle:thin:@127.0.0.1:1521:orcl", "scott", "tiger");rn rnrn[img=https://img-bbs.csdn.net/upload/201504/25/1429941537_131571.png][/img]rnrn为什么用127.0.0.1可以连接上,用192.168.1.102报错:rnException in thread "main" java.sql.SQLException: The Network Adapter could not establish the connectionrn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)rn at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:531)rn at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:221)rn at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)rn at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)rn at java.sql.DriverManager.getConnection(DriverManager.java:664)rn at java.sql.DriverManager.getConnection(DriverManager.java:247)rn at TestJDBC.main(TestJDBC.java:8)rnCaused by: oracle.net.ns.NetException: The Network Adapter could not establish the connectionrn at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)rn at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)rn at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)rn at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)rn at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)rn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)rn ... 7 morernCaused by: java.net.ConnectException: Connection refused: connectrn at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)rn at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)rn at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)rn at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)rn at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)rn at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)rn at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)rn at java.net.Socket.connect(Socket.java:589)rn at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)rn at oracle.net.nt.ConnOption.connect(ConnOption.java:123)rn at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)rn ... 12 morern
jdbc连接sql报错
环境是XP系统,已经安装SP4补丁,3个包已经放在/lib下,sql2000的登录模式是混合登录,用户名和密码均为"sa",驱动数据库没有报错,连接数据库却不行,具体代码如下rn<%@page contentType="text/html;charset=gbk"%>rn<%@page import="java.sql.*"%>rn<%!rn String dbdriver="com.microsoft.jdbc.sqlserver.SQLServerDriver";rn String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bookmanage";rn String user="sa";rn String password="sa";rn Connection conn=null;rn String sql=null;rn PreparedStatement pstat=null;rn%>rn<%rn //启动数据库驱动rn tryrn rn Class.forName(dbdriver);rn rn catch(Exception e)rn rn out.println(e);rn rn //注明:没写以上代码是没有报错也没有异常的rn //连接数据库rn tryrn rn conn=DriverManager.getConnection(url,user,password);rn rn catch(Exception e)rn rn out.println(e);rn rn rn%>rn在浏览器运行时报错如下:rnorg.apache.jasper.JasperException: An exception occurred processing JSP page /databasedemo/sqldemo.jsp at line 25rnrn22: //连接数据库rn23: tryrn24: rn25: conn=DriverManager.getConnection(url,user,password);rn26: rn27: catch(Exception e)rn28: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrn
jdbc连MySQL报错
页面提示错误:org.apache.jasper.JasperException: An exception occurred processing JSP page /MySQLTest.jsp at line 红色那行,请教如何修改?rn<%@ page contentType="text/html;charset=gb2312"%>rn<%@ page language="java"%>rn<%@ page import="com.mysql.jdbc.*"%>rn<%@ page import="java.sql.*"%>rnrn<%rnString driverName="com.mysql.jdbc.Driver";rnrnString userName="root";rnString userPwd="root";rnString dbName="home";rnString tableName="people";rnrn//连接字符串rnString url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPwd;rn[color=#FF0000]Class.forName("com.mysql.jdbc.Driver").newInstance();[/color]rnjava.sql.Connection conn=DriverManager.getConnection(url);rnout.print("数据库连接成功!");rn%>
有没有大神帮忙解决SQL2008问题
右键执行编辑命令就会提示这个,求大神帮忙解决
VB报错462,请大神帮忙解决
[code=vb]Private Sub CommandButton输出通知到Word文件_Click()rn Dim Word对象 As New Word.Application, 当前路径, 导出文件名, 导出路径文件名, i, jrn Dim Str1, Str2rn 当前路径 = ThisWorkbook.Pathrn 最后行号 = Sheets("数据").Range("B65536").End(xlUp).Rowrn 判断 = 0rn For i = 2 To 最后行号rn 导出文件名 = "标准说明-"rn FileCopy 当前路径 & "\模板.docx", 当前路径 & "\" & 导出文件名 & Sheets("数据").Range("A" & i) & ".doc"rn 导出路径文件名 = 当前路径 & "\" & 导出文件名 & Sheets("数据").Range("A" & i) & ".doc"rn With Word对象rn .Documents.Open 导出路径文件名rn .Visible = Falsern rn With ActiveDocument.Sections(4).Headers(wdHeaderFooterPrimary)‘调用第二次在这爆出462rn .Range.Text = VBA.Replace(.Range.Text, "项目名称", Sheets("数据").Range("A" & i).Text, 1, 1, vbTextCompare)rn End Withrn Do While .Selection.Find.Execute("项目名称") '寻找客户这个关键词,将其用表格中的姓名来代替rn .Selection.Text = Sheets("数据").Range("A" & i).Textrn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("设计编号值")rn .Selection.Text = Sheets("数据").Range("E" & i).Textrn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("项目编码")rn .Selection.Text = Sheets("数据").Range("F" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("月份一")rn .Selection.Text = Sheets("数据").Range("G" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("月份二")rn .Selection.Text = Sheets("数据").Range("H" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("工程描述")rn .Selection.Text = Sheets("数据").Range("I" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("工程总投资值")rn .Selection.Text = Sheets("数据").Range("J" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("安装工程费值")rn .Selection.Text = Sheets("数据").Range("K" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("设备购置费值")rn .Selection.Text = Sheets("数据").Range("L" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("勘察设计费值")rn .Selection.Text = Sheets("数据").Range("M" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("地勘费值")rn .Selection.Text = Sheets("数据").Range("N" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("检测费值")rn .Selection.Text = Sheets("数据").Range("O" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("工程监理费值")rn .Selection.Text = Sheets("数据").Range("P" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("安全生产费值")rn .Selection.Text = Sheets("数据").Range("Q" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("机构审计费值")rn .Selection.Text = Sheets("数据").Range("R" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("基站机房装修值")rn .Selection.Text = Sheets("数据").Range("S" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("外电引入值")rn .Selection.Text = Sheets("数据").Range("T" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("选址费值")rn .Selection.Text = Sheets("数据").Range("U" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("增值税总计")rn .Selection.Text = Sheets("数据").Range("W" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("设备税金")rn .Selection.Text = Sheets("数据").Range("X" & i).Textrn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("勘察税金")rn .Selection.Text = Sheets("数据").Range("Y" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("地勘税金")rn .Selection.Text = Sheets("数据").Range("Z" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("检测费税金")rn .Selection.Text = Sheets("数据").Range("AA" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("监理费税金")rn .Selection.Text = Sheets("数据").Range("AB" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("审计费税金")rn .Selection.Text = Sheets("数据").Range("AC" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("地址值")rn .Selection.Text = Sheets("数据").Range("D" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("经度值")rn .Selection.Text = Sheets("数据").Range("B" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("纬度值")rn .Selection.Text = Sheets("数据").Range("C" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("运营商值")rn .Selection.Text = Sheets("数据").Range("AD" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("塔桅信息")rn .Selection.Text = Sheets("数据").Range("AE" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("其他费用值")rn .Selection.Text = Sheets("数据").Range("V" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn Do While .Selection.Find.Execute("项目名称") '查找到指定字符串rn .ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader '设置位置在页眉rn .Selection.HomeKey Unit:=wdStory '光标置于文件首rn .Selection.Text = Sheets("数据").Range("A" & i).Text '替换字符串rn .Selection.HomeKey Unit:=6rn Looprn End Withrn Word对象.Documents.Savern Word对象.Quitrn Set Word对象 = Nothingrn Next irnEnd Sub[/code]
报错,不会解决了。。。求大神帮忙看一下
using System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Linq;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Runtime.InteropServices;rnusing System.Management;rnusing System.Net.NetworkInformation;rnusing System.Text.RegularExpressions;rnrn rnrnnamespace WebPagesrnrn public partial class Form1 : Formrn rn ConfigFile cf = ConfigFile.Instanse; rn public Form1()rn rn InitializeComponent();rn rnrn private void button1_Click(object sender, EventArgs e)rn rn DialogResult choice;  // 用户的选择rn choice = MessageBox.Show("确定要退出吗?", "退出系统", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);rnrn if (choice == DialogResult.OK)rn rn Application.Exit(); // 退出应用程序rn rn rnrnrn ////ShellExecute函数ShowCmd参数可选值 rnrn /// rn /// 小程序rn /// rnrnrn //开始删除IE缓存、打开计算器、打开记事本rnrn public enum ShowCommands : int rn rn SW_HIDE = 0, rn SW_SHOWNORMAL = 1, rn SW_NORMAL = 1, rn SW_SHOWMINIMIZED = 2, rn SW_SHOWMAXIMIZED = 3, rn SW_MAXIMIZE = 3, rn SW_SHOWNOACTIVATE = 4, rn SW_SHOW = 5, rn SW_MINIMIZE = 6, rn SW_SHOWMINNOACTIVE = 7, rn SW_SHOWNA = 8, rn SW_RESTORE = 9, rn SW_SHOWDEFAULT = 10, rn SW_FORCEMINIMIZE = 11, rn SW_MAX = 11 rn rn rn //调用Win32 API rn [DllImport("shell32.dll")] rn static extern IntPtr ShellExecute(IntPtr hwnd, string lpOperation, string lpFile, rn string lpParameters, string lpDirectory, ShowCommands nShowCmd); rnrn private void button43_Click(object sender, EventArgs e)rn rn //删除IE临时文件rn ShellExecute(IntPtr.Zero, "open", "rundll32.exe",rn "InetCpl.cpl,ClearMyTracksByProcess 255", "", ShowCommands.SW_SHOWMAXIMIZED);rn rnrn private void button44_Click(object sender, EventArgs e)rn rn //调用calc.exe打开计算器 rn ShellExecute(this.Handle, "open", "calc.exe", null, null, ShowCommands.SW_FORCEMINIMIZE); rn rnrn private void button45_Click(object sender, EventArgs e)rn rn //调用NOTEPAD.EXE打开记事本 rn ShellExecute(this.Handle, "open", "NOTEPAD.EXE", null, null, ShowCommands.SW_SHOWNORMAL); rn rn //结束删除IE缓存、打开计算器、打开记事本rnrn ///rnrn #region 加载配置文件中的信息 rn /// rn /// 加载配置文件中的信息 rn /// rn protected void loadConfig() rn rn cf.fileName = AppDomain.CurrentDomain.BaseDirectory + "\\config.ini"; rn txtIP.Text = cf["ip地址"]; rn txtSubMark.Text = cf["子网掩码"]; rn txtGateWay.Text = cf["默认网关"]; rn txtDNS1.Text = cf["主DNS"]; rn txtDNS2.Text = cf["备用DNS"]; rn rn #endregion rn rn #region 设置ip信息到网卡 rn private void btnSettingNetwork_Click(object sender, EventArgs e) rn rn rn try rn rn if (!IsIpaddress(txtIP.Text.Trim())) rn rn MessageBox.Show("ip格式不正确!"); return; rn rn if (!IsIpaddress(txtSubMark.Text.Trim())) rn rn MessageBox.Show("子网掩码格式不正确!"); return; rn rn if (!IsIpaddress(txtGateWay.Text.Trim())) rn rn MessageBox.Show("网关格式不正确!"); return; rn rn if (!IsIpaddress(txtDNS1.Text.Trim())) rn rn MessageBox.Show("DNS1格式不正确!"); return; rn rn if (!IsIpaddress(txtDNS2.Text.Trim())) rn rn MessageBox.Show("DNS2格式不正确!"); return; rn rn string[] ip = new string[] txtIP.Text.Trim() ; rn string[] SubMark = new string[] txtSubMark.Text.Trim() ; rn string[] GateWay = new string[] txtGateWay.Text.Trim() ; rn string[] DNS = new string[] txtDNS1.Text.Trim(),txtDNS2.Text.Trim() ; rn SetIpInfo(ip, SubMark, GateWay, DNS); rn cf["ip地址"] = txtIP.Text.Trim(); rn cf["子网掩码"] = txtSubMark.Text.Trim(); rn cf["默认网关"] = txtGateWay.Text.Trim(); rn cf["主DNS"] = txtDNS1.Text.Trim(); rn cf["备用DNS"] = txtDNS2.Text.Trim(); rn MessageBox.Show("ip信息设置成功!","成功提示",MessageBoxButtons.OK,MessageBoxIcon.Information); rn rn catch(Exception er) rn rn MessageBox.Show("设置出错:"+er.Message,"出错提示",MessageBoxButtons.OK,MessageBoxIcon.Error); rn rn rn rn protected void SetIpInfo(string []ip,string []SubMark,string []GateWay,string []DNS) rn rn ManagementBaseObject inPar = null; rn ManagementBaseObject outPar = null; rn ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); rn ManagementObjectCollection moc = mc.GetInstances(); rn foreach (ManagementObject mo in moc) rn rn if (!(bool)mo["IPEnabled"]) continue; rn inPar = mo.GetMethodParameters("EnableStatic"); rn inPar["IPAddress"] = ip;//ip地址 rn inPar["SubnetMask"] =SubMark; //子网掩码 rn mo.InvokeMethod("EnableStatic", inPar, null);//执行 rn rn inPar = mo.GetMethodParameters("SetGateways"); rn inPar["DefaultIPGateway"] = GateWay; //设置网关地址 1.网关;2.备用网关 rn outPar = mo.InvokeMethod("SetGateways", inPar, null);//执行 rn rn inPar = mo.GetMethodParameters("SetDNSServerSearchOrder"); rn inPar["DNSServerSearchOrder"] = DNS; //设置DNS 1.DNS 2.备用DNS rn mo.InvokeMethod("SetDNSServerSearchOrder", inPar, null);// 执行 rn break; //只设置一张网卡,不能多张。 rn rn rn rn #endregion rn rn #region 从网卡获取ip设置信息 rn /// rn /// 从网卡获取ip设置信息 rn /// rn /// rn /// rn private void btnGetFromNetwork_Click(object sender, EventArgs e) rn rn NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); rn foreach (NetworkInterface adapter in nics) rn rn bool Pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet); //判断是否是以太网连接 rn if (Pd1) rn rn IPInterfaceProperties ip = adapter.GetIPProperties(); //IP配置信息 rn if (ip.UnicastAddresses.Count > 0) rn rn txtIP.Text = ip.UnicastAddresses[0].Address.ToString();//IP地址 rn txtSubMark.Text = ip.UnicastAddresses[0].IPv4Mask.ToString();//子网掩码 rn rn rn if (ip.GatewayAddresses.Count > 0) rn rn txtGateWay.Text = ip.GatewayAddresses[0].Address.ToString();//默认网关 rn rn int DnsCount = ip.DnsAddresses.Count; rn Console.WriteLine("DNS服务器地址:"); rn if (DnsCount > 0) rn rn try rn rn txtDNS1.Text = ip.DnsAddresses[0].ToString(); //主DNS rn txtDNS2.Text = ip.DnsAddresses[1].ToString(); //备用DNS地址 rn rn catch(Exception er) rn rn throw er; rn rn rn rn rn rn #endregion rn rn #region 判断是否是正确的ip地址 rn /// rn /// 判断是否是正确的ip地址 rn /// rn /// rn /// rn protected bool IsIpaddress(string ipaddress) rn rn string[] nums = ipaddress.Split('.'); rn if (nums.Length != 4) return false; rn foreach (string num in nums) rn rn if ( Convert.ToInt32(num) < 0 || Convert.ToInt32(num) > 255) return false; rn rn return true; rn rn #endregion rn rn #region Form1_Load rn private void Form1_Load(object sender, EventArgs e) rn rn loadConfig(); rn rn #endregion rn rnrn rn rnrnrn报错:rn未能找到类型或命名空间名称“ManagementBaseObject”(是否缺少 using 指令或程序集引用?)rn未能找到类型或命名空间名称“ManagementClass”(是否缺少 using 指令或程序集引用?)rn未能找到类型或命名空间名称“ManagementObjectCollection”(是否缺少 using 指令或程序集引用?)rnrnrn
shell脚本报错,求大神帮忙解决
shell脚本内容如下rnrn#!/bin/shrnexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBKrnora_path='abp_query/bhp2pz_P@new_hss'rnrntable_name='tmp_pldx_warn'rnrn#获得文件地址rnrncd /home/abp/zjprnmyFile="`date '+%Y%m%d'`*.csv"rn echo $myFilern#检查文件是否存在 rn if [ ! -f "myFile" ]; rnthen rn#登录数据库 rn sqlplus -s $ora_path <
JDBC连接MYSQL,谁给你解决呀???
是JDBC的问题,请看。。rnhttp://www.chinajavaworld.net/forum/topic.cgi?forum=23&topic=2522&show=0
jdbc连接MySql解决中文乱码问题
当jdbc连接数据库时,如果输入的是中文,则在数据库中表现出来的是?号,而无法利用中文输出,请问这种情况怎么解决???
JDBC解决java连接mysql出错问题
今天调试JDBC连接数据库操作时报了这样一个错误,调试无果com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. 解决方案:可能由于mysql版本太高,我以前是mysql8结果换成mysql5之后,完美运行没有报错,卸...
解决jdbc连接mysql报时区错误
连接mysql的时候报了这个错误: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone 这是mysql的时区和本地不一致 可以这样子解决,在连接url后面添加时区参数serverTimezone spring...
jdbc连接MYSQL出乱码怎么解决?
我是用hibernate连接的MySQL数据库,我该成UTF-8 数据库里面查询是乱码 jdbc查询页是乱码, 我在网上查了在连接后面加编码也试了 还是不行。rn连接配置rn rn rn rn rn rn rn rn rnrn数据库编码信息:rnmysql> show VARIABLES like 'character_%';rn+--------------------------+----------------------------------------------------rn-----+rn| Variable_name | Valuern |rn+--------------------------+----------------------------------------------------rn-----+rn| character_set_client | utf8rn |rn| character_set_connection | utf8rn |rn| character_set_database | utf8rn |rn| character_set_filesystem | binaryrn |rn| character_set_results | utf8rn |rn| character_set_server | gb2312rn |rn| character_set_system | utf8rn |rn| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.1\share\charsrnets\ |rn+--------------------------+----------------------------------------------------rn-----+rn8 rows in set (0.00 sec)rn那位知道那出问题的 请告诉一下 谢谢
有没有大神帮忙看一下
对一个表进行排序,把行首单元格相同的行排到一起rnrnFor i = 2 To T_Sheet.UsedRange.Rows.CountrnFor j = i + 1 To T_Sheet.UsedRange.Rows.Countrn If T_Sheet.Cells(i, 1) = T_Sheet.Cells(j, 1) Thenrn Rows(i & ":" & i).Select rn Selection.Cutrn Rows(j + 1 & ":" & j + 1).Selectrn Selection.Insert Shift:=xlDown rn Range("R2").Select rn Exit Forrn Elsern End Ifrn Next jrnNext i
大神帮忙解决一下菜单响应问题。
最近学习java的GUI图形界面编程,我想响应菜单事件,然后显示出菜单的内容。可是编译没有错,但是点击菜单就是不能显示出内容,什么问题?希望大神帮忙解决!代码如下:rnrnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnimport javax.swing.event.*;rnimport java.io.*;rnimport java.util.*;rnpublic class MyFramern rn Frame myframe = new Frame("蓝点执行框");rn MyAction ma = new MyAction();rn /*rn 登入框,成员变量。rn rn */ rn rn /*rn 设计出密码,账号。rn */rn rn rn rn /*rn 蓝点执行框rn rn */rn rn private Menu btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8;rn private Label lb1,lb2,lb3;rn private MenuBar mb;rn private MenuItem m1,m2,m3,m4,m5,m6;rn private JTextArea txt;rn private TextField txt1;rn private Button duizan;rn private Panel p,p1,p2,p3;rn rn rn rn rn rn rn rn public MyFrame()rn myframe.setLayout(new FlowLayout());rn mb = new MenuBar();rn btn1 = new Menu("堆栈");btn2 = new Menu("队列");btn3 = new Menu("排序");rn btn4 = new Menu("查找");btn5 = new Menu("递归");btn6 = new Menu("树");btn7 = new Menu("图");btn8 = new Menu("函数图形");rn m1 = new MenuItem("插入排序");m2 = new MenuItem("顺序排序");m3 = new MenuItem("冒泡排序");rn btn3.add(m1);btn3.add(m2);btn3.add(m3);rn m4 = new MenuItem("二分查找");m5 = new MenuItem("顺序查找");m6 = new MenuItem("索引查找");rn btn4.add(m4);btn4.add(m5);btn4.add(m6);rn mb.add(btn1);mb.add(btn2);mb.add(btn3);rn mb.add(btn4);mb.add(btn5);mb.add(btn6);mb.add(btn7);mb.add(btn8);rn lb1 = new Label("代码显示区");rn myframe.add(lb1);rn txt = new JTextArea("代码显示区",23,33);rn txt.setLineWrap(true);rn JScrollPane jsp = new JScrollPane(txt);rn jsp.setBounds(10,10,10,10);rn myframe.add(jsp);rn lb2 = new Label("代码执行区");rn //btn1.setActionCommand("堆栈");rn lb3 = new Label("入栈数据:");lb3.setBounds(10,10,10,10);rn txt1 = new TextField(20); txt1.setBounds(10,10,15,15);rn duizan = new Button("确定");duizan.setBounds(10,10,10,10);rn btn1.addActionListener(ma);rn myframe.setMenuBar(mb);rn myframe.add(lb2);rn //myframe.add(lb3);myframe.add(txt1);myframe.add(duizan);rn myframe.setBounds(300,400,400,700);rn myframe.setBackground(new Color(204,204,255));rn myframe.setTitle("蓝点数据结构");rn myframe.setLocationRelativeTo(null);rn //this.setResizable(false);rn myframe.addWindowListener(new Listener());rn myframe.setVisible(true);rn rn rn class Listener extends WindowAdapterrn public void windowClosing(WindowEvent e)rn System.exit(0);rn rn rn rn class MyAction implements ActionListenerrn public void actionPerformed(ActionEvent e)rn if(e.getSource() == btn1)rn myframe.add(lb3);myframe.add(txt1);myframe.add(duizan);rn rn rn rn rn public static void main(String[] args)rn new MyFrame();rn rnrnrn
各位大神帮忙解决一下存储过程问题!!!!!!!!
各位大神帮忙看看如下存储过程:rn这是一个关于医院瓶贴打印的存储过程,大意是根据用药频度从医嘱表中将数据拆分成瓶贴,在数据同步的时候,会建一张临时表#yztmp,现在我需要在在临时表中的字段ssmc同步我现有表NURSE_CQYZZXJL 中yztm字段,并可以调用实例exec usp_bq_djdy_ex 860,0, "20140623",0, 0, '"01","02","10"',1,1--【Ztsql】时都可以回滚数据。rn我加进去的是如下一段(共四个地方)rn --hzx rn update #yztmp rn set ssmc=c.yztm rn from #yztmp a, NURSE_CQYZZXJL c(nolock) rn where a.yzxh=c.xh and a.fzxh=c.fzxh rn and REPLACE(convert(varchar(10),c.yzxsj,8),'-','')= @yzxrq rn and substring(ltrim(a.zxsj),1,2)=substring(ltrim(c.yzxsj),12,2) rn --hzx rn每次有新数据生成的时候,数据会发生同步,但是 程序里每次点击都会调用实例exec usp_bq_djdy_ex 860,0, "20140623",0, 0, '"01","02","10"',1,1--【Ztsql】 ,但没有数据,大神看看是哪里判断有问题,还是写的不对,才导致调用实例的时候没有数据!!!!!rn由于存储过程太长,无法放进来,帮忙解决可以联系qq1005626880rn rn
Java连接MySQL问题,求大神帮忙
新人,在家自学java,学到JDBC数据库编程,遇到问题无法处理,求大神帮忙。问题如下rn代码1如下:(在MySQL数据库中创建一个名称为db_user的数据库。使用纯java驱动方式连接数据库:)rnpackage com.mxl.jdbc;rnimport java.sql.Connection;rnimport java.sql.DriverManager;rnpublic class ConnectionDBrn public static void main(String[] args)rn Connection conn =null;rn tryrn Class.forName("com.mysql.jdbc.Driver");rn String url="jdbc:mysql://localhost:3306/db_user";rn conn =DriverManager.getConnection(url,"root","root");rn System.out.println("连接数据库成功!");rn catch(Exception e)rn System.out.println("数据连接失败!");rn finallyrn tryrn conn.close();rn catch(Exception e)rn e.printStackTrace();rn rn rn rnrn问题1:运行显示:数据连接失败!rn java.lang.NullPointerExceptionrn at com.mxl.jdbc.ConnectionDB.main(ConnectionDB.java:16)rn代码2:rnpackage com.mxl.jdbc;rnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnpublic class StatementDemorn public static void main(String[] agrs)rn Connection connection=null;rn Statement statement=null;rn tryrn String insertSql="insert into tab_user value(1,'admin','admin','王丽丽','女',25)";rn String updateSql="update tab_user set realname='王丽'where id=1";rn Class.forName("com.mysql.jdbc.Driver");rn connection=DriverManager.getConnection(""+"jdbc:mysql://localhost/db_user?useUnicode=ture&&characterEncoding=GBK","root","root");rn statement=connection.createStatement();rn int num=statement.executeUpdate(insertSql);rn if(num>0)rn int updateNum=statement.executeUpdate(updateSql);rn if(updateNum>0)rn System.out.println("向tab_user表添加并修改一条数据!");rn elsern System.out.println("修改失败");rn rn elsern System.out.println("添加失败");rn rn catch(ClassNotFoundException e1)rn System.out.println("无法找到驱动类");rn catch(SQLException e2)rn System.out.println("执行SQL语句出错");rn e2.printStackTrace();rn catch(Exception e3)rn System.out.println(e3.getMessage());rn finallyrn tryrn if(connection!=null&&(!connection.isClosed()))rn connection.close();rn rn if(statement!=null)rn statement.close();rn statement=null;rn rn catch(SQLException e)rn e.printStackTrace();rn rn rn rnrn运行结果:执行SQL语句出错rnjava.sql.SQLException: The connection property 'useUnicode' only accepts values of the form: 'true', 'false!'!, 'yes!'! or 'no'. The value 'ture' is not in this setrnrnrnrnrnrn昨天才装的MySQL,JDBC驱动程序在D:\Program Files\Java\jdk1.8.0_31\jre\lib和D:\Program Files\Java\jdk1.8.0_31\lib都存放有,在Myeclipse上加载了jar驱动包。rn求大神告知是否是配置出了问题,还是程序问题?怎么修改?
有大神可以帮忙解决一下吗
Android使用CLE,初始化rn[img=https://img-bbs.csdn.net/upload/201906/23/1561257366_29432.jpg][/img]rn直接闪退不报错rn设了断点发现到这程序就中止了rnstarcore= StarCoreFactory.GetFactory()
求大神帮忙解决一下移植问题
我们公司有个收费系统是在Win98系统中使用,用的是ACCESS数据库(因为公司没有续费维护和软件公司倒闭...多年来一直未升级系统)。rn 最近我把那个系统放到了虚拟机中,虚拟机和原来那台计算机中安装的软件一样,都是office97和VF6.0。用收费系统的其他功能都没问题,但是只要是使用日历控件的页面就会出问题。 rn rn 提示“这个对象不包含OLE自动对象day,您试图运行一个Visual Basic过程为对象设置属性或方法的过程。但是使用组件设置OLE自动对象的属性或方法是无效的。”rn rn 宏里面的内容是“[Forms]![f203_setdate]![monthselector].[day]<1 或 [Forms]![f203_setdate]![monthselector].[day]>31”
新手求大神帮忙解决一下,拜谢!!!
用C++写一个*号组成的等腰三角形,打印在控制台上可以通过键盘控制使它上下左右移动。要求用类写,注释随意。
请求大神,帮忙解决一下这个习题!!
定一个Stack类,用来建立可存放整数的堆栈对象。该类的成员如下:rn(1)aryData()数组:该数组用来存放堆栈内的元素.rn(2)Stack(int Num)构造函数:用来建立可存放Num个元素的aryData()数组。rn(3)public int Pop()方法:用来取出aryData数组中的一个元素,如果无元素,则返回0.rn(4)public void Push(int n):可将n值放入到啊人员Data数组堆栈中,如果堆栈已满则显示"堆栈已满"的消息.rn(5)public void PrintSatck():打印出堆栈内所有元素.rnrn有点头绪,但就是写不出代码,新手一个,帮帮忙,谢谢,感激不尽!!
大神们,都进来帮忙解决一下!!!
有没有人开发过,基于OpenStack 的JavaSDK JOSS网盘?采用的是Spring框架+joss,实现一个上传的功能,有没有demo参考一下。求大神分享...
哪里错了,求大神帮忙解决一下
rn#include rnvoid ZH()rnrn int a[3][4];rn int n,m;rn printf("原矩阵是:\n");rn for(n=0;n<3;n++)rn rn for(m=0;m<4;m++)rn rn printf("a[%d][%d]=",n,m);rn scanf("%d\n",&a[n][m]);rn rn rn for(n=0;n<3;n++)rn rn for(m=0;m<4;m++)rn rn a[m][n]=a[n][m];rn rn rn printf("变换后的矩阵是:");rn printf("%d",a[m][n]);rn if(n%2==0)printf("\n");rnrnvoid main()rnrn ZH();rnrn
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池