假如你的笔记本需要在家里和公司频繁地进行IP地址切换,是不是很烦?而网上大量的切换工具对Win7均无效,怎么办?请不要担心,自己DIY一个批处理文件就行了。
注意,以下是针对IPv4进行的修改。
另外,安装了360可能会有风险提醒,请大家不要担心,放心点击通过,此代码毫无风险,童叟无欺,尽可安全使用。
首先,打开记事本,新建一个"IP切换.txt",内容如下,
最后,把文件名改为"IP切换.bat"就大功告成了。
@echo off
rem //设置变量本地连接, 根据你的需要更改
set Nic="本地连接 3"
rem //可以根据你的需要更改
set Addr=192.168.1.11
set Mask=255.255.255.0
set Gway=192.168.1.1
set Dns=192.168.1.1
set Addr2=10.32.66.34
set Mask2=255.255.255.192
set Gway2=10.32.66.62
set Dns1=202.107.196.144
set Dns2=202.101.172.46
rem //以上对应分别是IP地址、子网掩码、网关、首选DNS、备用DNS ,自己根据情况修改
rem //家里的DNS和公司一样则可以用以上代码,不一样可能需要稍作修改
echo ↗Design by 鲁胜迪,龙腾虎跃↖
echo ★ 1 设置为公司IP ★
echo ★ 2 设置为***综合楼IP★
echo ★ 3 设置为动态IP ★
echo ★ 4 退出 ★
echo ●●●请选择项目回车●●●
set /p answer=
if %answer%==1 goto 1
if %answer%==2 goto 2
if %answer%==3 goto 3
if %answer%==4 goto 4
:1
echo 正在进行静态公司IP 设置,请稍等...
rem //可以根据你的需要更改
echo. I P 地址 = %Addr%
echo. 子网掩码 = %Mask%
netsh interface ipv4 set address name=%Nic% source=static addr=%Addr% mask=%Mask% gateway=%Gway% gwmetric=0 >nul
echo. 首选 DNS = %Dns%
netsh interface ipv4 set dns name=%Nic% source=static addr=%Dns% register=PRIMARY >nul
echo. 备用 DNS = %Dns%
netsh interface ipv4 add dns name=%Nic% addr=%Dns% index=2 >nul
echo ----
echo 全部设置完成!
pause
goto end
:2
echo 正在进行静态萧山区政府综合楼IP设置,请稍等...
rem //可以根据你的需要更改
echo. I P 地址 = %addr2%
echo. 子网掩码 = %Mask2%
netsh interface ipv4 set address name=%Nic% source=static addr=%addr2% mask=%Mask2% gateway=%Gway2% gwmetric=0 >nul
echo. 首选 DNS = %Dns1%
netsh interface ipv4 set dns name=%Nic% source=static addr=%Dns1% register=PRIMARY >nul
echo. 备用 DNS = %Dns2%
netsh interface ipv4 add dns name=%Nic% addr=%Dns2% index=2 >nul
echo ----
echo 全部设置完成!
pause
goto end
:3
echo 正在进行动态IP设置,请稍等...
echo. IP 地址正在从DHCP自动获取...
netsh interface ip set address %Nic% dhcp
echo. DNS地址正在从DHCP自动获取...
netsh interface ip set dns %Nic% dhcp
echo ----
echo 全部设置完成!
pause
:4
echo bye!
goto end
我使用的是JSF+Spring+Hibernate,在实现文件上传时遇到了这个问题,每次上传一个文件就会出现一次这个警告,但是似乎并不影响文件的上传,文件还是可以保存到数据库中相应的表中的。
想解决这个问题,但不知道从何下手个,希望能有高手指点一下。
Hibernate: insert into WTCX.T_FILE (FILENAME, CONTENT, FILESUFFIX, FILEID) values (?, ?, ?, ?)
2008-09-19 15:56:28,125 ERROR [org.springframework.jdbc.support.lob.OracleLobHandler] - Could not free Oracle LOB
java.sql.SQLException: 必须登录到服务器
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.TTC7Protocol.assertLoggedIn(TTC7Protocol.java:2196)
at oracle.jdbc.ttc7.TTC7Protocol.freeTemporaryLob(TTC7Protocol.java:3233)
at oracle.sql.LobDBAccessImpl.freeTemporary(LobDBAccessImpl.java:377)
at oracle.sql.BLOB.freeTemporary(BLOB.java:842)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.close(OracleLobHandler.java:412)
at org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization.afterCompletion(SpringLobCreatorSynchronization.java:76)
at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:133)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:904)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:879)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:707)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy22.insertFile(Unknown Source)
at cn.com.hd.zzjgManage.web.UploadBean.saveAction(UploadBean.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cn.com.hd.common.filter.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cn.com.hd.common.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)