- 浏览: 891372 次
- 性别:
- 来自: 杭州
-
文章分类
最新评论
-
hzw2312:
C = sin(MLatA)*sin(MLatB)*cos(M ...
根据地球上任意两点的经纬度计算两点间的距离 -
zhang_sun:
rewind方法的limit又是多少呢?等于capacity? ...
ByteBuffer的flip,clear及rewind区别 -
kalogen:
一种每次都获取到不同的随机数的办法int ranseed=12 ...
J2ME中Random类的使用 -
kalogen:
估计部署在某个端口下吧,仔细检查一下发布的配置文件
Tomcat负载均衡和集群环境的搭建 -
zhuchao_ko:
文件大点就嗝屁了~~~
Axis 1.4 上传二进制文件(base64Binary)
关于使用CachedRowSetImpl出现:Invalid scale size. Cannot be less than zero 在使用NUMBER类型时,用Oracle 9i JDBC时一点问题没有,而在10G下就会出现:Invalid scale size. Cannot be less than zero 原来10G JDBC driver 对sun’s com.sun.rowset.CachedRowSetImpl 存在一些问题! 解决方法: 1. select num+0 num from count 2.select NVL(num,0) from count
=========================================另
今天遇到Invalid scale size. Cannot be less than zero 这么个问题。之前也遇到过,具体什么原因也没有查看,网上找一些方法就解决了。
问题原因:
jdbc驱动的一个bug. 网上几乎大部分的解释是对于number类型的值支持有问题。
count(), sum() 等这种集合函数的使用, 使得返回的结果有问题。(解决方法1)
还有就是针对不是集合的,今天遇到的就是这么样情况,之前是把某个数据munber的精度修改就是了,
而今天的是跨数据库的操作两个系统的整合操作,另一个系统只提供了sql语句并且包含视图。这次我就没办法像之前
那样去修改字段的精度了。但是并不是没有解决方法,(见解决方法2).
解决方法:
1. 集合解决
SELECT count(..), ...
需要修改成
SELECT count(..) + 0, ...
2.jdbc驱动的一个bug对于number类型的值支持有问题
这里我们不讨论为什么,只讨论如何修改。
对于只是某个字段的number的问题,我们可以在数据库中修改其精度。
对于不能修改表的数据结构的 我们 可以在number字段里面有数值型的字段,将其TO_CHAR之后,就OK了。
==========================================
首先,非常鄙视ResultSet这个东东的列索引居然是从1开始的这个事情。
这个异常源自于oracle驱动面对一个数值型的返回字段时,在得到指定的字段小数点右边的数值数量时(Gets the designated column's number of digits to right of the decimal point.这个是原文),居然会返回-127,而oracle本身的cacheRowSet实现不允许这种情况出现,于是就会报标题所说的异常。
在GOOGLE之后,唉,使用了 http://forum.java.sun.com/thread.jspa?threadID=569712 中Pedrinho的解决方法建立了两个对ResultSet与ResultSetMetaData接口的decorate类,这两个类内容无它,极其无聊,建议所有人都不要看。
这个是ResultSet的decorate类:
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
public class ResultSetWrapper implements ResultSet {
private ResultSet wrapped;
public ResultSetWrapper(ResultSet wrapped) {
this.wrapped = wrapped;
}
public boolean absolute(int row) throws SQLException {
return wrapped.absolute(row);
}
public void afterLast() throws SQLException {
wrapped.afterLast();
}
public void beforeFirst() throws SQLException {
wrapped.beforeFirst();
}
public void cancelRowUpdates() throws SQLException {
wrapped.cancelRowUpdates();
}
public void clearWarnings() throws SQLException {
wrapped.clearWarnings();
}
public void close() throws SQLException {
wrapped.close();
}
public void deleteRow() throws SQLException {
wrapped.deleteRow();
}
public int findColumn(String columnName) throws SQLException {
return wrapped.findColumn(columnName);
}
public boolean first() throws SQLException {
return wrapped.first();
}
public Array getArray(int i) throws SQLException {
return wrapped.getArray(i);
}
public Array getArray(String colName) throws SQLException {
return wrapped.getArray(colName);
}
public InputStream getAsciiStream(int columnIndex) throws SQLException {
return wrapped.getAsciiStream(columnIndex);
}
public InputStream getAsciiStream(String columnName) throws SQLException {
return wrapped.getAsciiStream(columnName);
}
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
return wrapped.getBigDecimal(columnIndex);
}
public BigDecimal getBigDecimal(String columnName) throws SQLException {
return wrapped.getBigDecimal(columnName);
}
public BigDecimal getBigDecimal(int columnIndex, int scale)
throws SQLException {
return wrapped.getBigDecimal(columnIndex, scale);
}
public BigDecimal getBigDecimal(String columnName, int scale)
throws SQLException {
return wrapped.getBigDecimal(columnName, scale);
}
public InputStream getBinaryStream(int columnIndex) throws SQLException {
return wrapped.getBinaryStream(columnIndex);
}
public InputStream getBinaryStream(String columnName) throws SQLException {
return wrapped.getBinaryStream(columnName);
}
public Blob getBlob(int i) throws SQLException {
return wrapped.getBlob(i);
}
public Blob getBlob(String colName) throws SQLException {
return wrapped.getBlob(colName);
}
public boolean getBoolean(int columnIndex) throws SQLException {
return wrapped.getBoolean(columnIndex);
}
public boolean getBoolean(String columnName) throws SQLException {
return wrapped.getBoolean(columnName);
}
public byte getByte(int columnIndex) throws SQLException {
return wrapped.getByte(columnIndex);
}
public byte getByte(String columnName) throws SQLException {
return wrapped.getByte(columnName);
}
public byte[] getBytes(int columnIndex) throws SQLException {
return wrapped.getBytes(columnIndex);
}
public byte[] getBytes(String columnName) throws SQLException {
return wrapped.getBytes(columnName);
}
public Reader getCharacterStream(int columnIndex) throws SQLException {
return wrapped.getCharacterStream(columnIndex);
}
public Reader getCharacterStream(String columnName) throws SQLException {
return wrapped.getCharacterStream(columnName);
}
public Clob getClob(int i) throws SQLException {
return wrapped.getClob(i);
}
public Clob getClob(String colName) throws SQLException {
return wrapped.getClob(colName);
}
public int getConcurrency() throws SQLException {
return wrapped.getConcurrency();
}
public String getCursorName() throws SQLException {
return wrapped.getCursorName();
}
public Date getDate(int columnIndex) throws SQLException {
return wrapped.getDate(columnIndex);
}
public Date getDate(String columnName) throws SQLException {
return wrapped.getDate(columnName);
}
public Date getDate(int columnIndex, Calendar cal) throws SQLException {
return wrapped.getDate(columnIndex, cal);
}
public Date getDate(String columnName, Calendar cal) throws SQLException {
return wrapped.getDate(columnName, cal);
}
public double getDouble(int columnIndex) throws SQLException {
return wrapped.getDouble(columnIndex);
}
public double getDouble(String columnName) throws SQLException {
return wrapped.getDouble(columnName);
}
public int getFetchDirection() throws SQLException {
return wrapped.getFetchDirection();
}
public int getFetchSize() throws SQLException {
return wrapped.getFetchSize();
}
public float getFloat(int columnIndex) throws SQLException {
return wrapped.getFloat(columnIndex);
}
public float getFloat(String columnName) throws SQLException {
return wrapped.getFloat(columnName);
}
public int getInt(int columnIndex) throws SQLException {
return wrapped.getInt(columnIndex);
}
public int getInt(String columnName) throws SQLException {
return wrapped.getInt(columnName);
}
public long getLong(int columnIndex) throws SQLException {
return wrapped.getLong(columnIndex);
}
public long getLong(String columnName) throws SQLException {
return wrapped.getLong(columnName);
}
public ResultSetMetaData getMetaData() throws SQLException {
return new ResultSetMetaDataWrapper(this.wrapped.getMetaData());
}
public Object getObject(int columnIndex) throws SQLException {
return this.wrapped.getObject(columnIndex);
}
public Object getObject(String columnName) throws SQLException {
return this.wrapped.getObject(columnName);
}
public Object getObject(int arg0, Map arg1) throws SQLException {
return this.wrapped.getObject(arg0, arg1);
}
public Object getObject(String arg0, Map arg1) throws SQLException {
return this.wrapped.getObject(arg0, arg1);
}
public Ref getRef(int i) throws SQLException {
return this.wrapped.getRef(i);
}
public Ref getRef(String colName) throws SQLException {
return this.wrapped.getRef(colName);
}
public int getRow() throws SQLException {
return this.wrapped.getRow();
}
public short getShort(int columnIndex) throws SQLException {
return this.wrapped.getShort(columnIndex);
}
public short getShort(String columnName) throws SQLException {
return wrapped.getShort(columnName);
}
public Statement getStatement() throws SQLException {
return wrapped.getStatement();
}
public String getString(int columnIndex) throws SQLException {
return wrapped.getString(columnIndex);
}
public String getString(String columnName) throws SQLException {
return wrapped.getString(columnName);
}
public Time getTime(int columnIndex) throws SQLException {
return wrapped.getTime(columnIndex);
}
public Time getTime(String columnName) throws SQLException {
return wrapped.getTime(columnName);
}
public Time getTime(int columnIndex, Calendar cal) throws SQLException {
return wrapped.getTime(columnIndex, cal);
}
public Time getTime(String columnName, Calendar cal) throws SQLException {
return wrapped.getTime(columnName, cal);
}
public Timestamp getTimestamp(int columnIndex) throws SQLException {
return wrapped.getTimestamp(columnIndex);
}
public Timestamp getTimestamp(String columnName) throws SQLException {
return wrapped.getTimestamp(columnName);
}
public Timestamp getTimestamp(int columnIndex, Calendar cal)
throws SQLException {
return wrapped.getTimestamp(columnIndex, cal);
}
public Timestamp getTimestamp(String columnName, Calendar cal)
throws SQLException {
return wrapped.getTimestamp(columnName, cal);
}
public int getType() throws SQLException {
return wrapped.getType();
}
public URL getURL(int columnIndex) throws SQLException {
return wrapped.getURL(columnIndex);
}
public URL getURL(String columnName) throws SQLException {
return wrapped.getURL(columnName);
}
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
return wrapped.getUnicodeStream(columnIndex);
}
public InputStream getUnicodeStream(String columnName) throws SQLException {
return wrapped.getUnicodeStream(columnName);
}
public SQLWarning getWarnings() throws SQLException {
return wrapped.getWarnings();
}
public void insertRow() throws SQLException {
wrapped.insertRow();
}
public boolean isAfterLast() throws SQLException {
return wrapped.isAfterLast();
}
public boolean isBeforeFirst() throws SQLException {
return wrapped.isBeforeFirst();
}
public boolean isFirst() throws SQLException {
return wrapped.isFirst();
}
public boolean isLast() throws SQLException {
return wrapped.isLast();
}
public boolean last() throws SQLException {
return wrapped.last();
}
public void moveToCurrentRow() throws SQLException {
wrapped.moveToCurrentRow();
}
public void moveToInsertRow() throws SQLException {
wrapped.moveToInsertRow();
}
public boolean next() throws SQLException {
return wrapped.next();
}
public boolean previous() throws SQLException {
return wrapped.previous();
}
public void refreshRow() throws SQLException {
wrapped.refreshRow();
}
public boolean relative(int rows) throws SQLException {
return this.wrapped.relative(rows);
}
public boolean rowDeleted() throws SQLException {
return this.wrapped.rowDeleted();
}
public boolean rowInserted() throws SQLException {
return this.wrapped.rowInserted();
}
public boolean rowUpdated() throws SQLException {
return this.wrapped.rowUpdated();
}
public void setFetchDirection(int direction) throws SQLException {
this.wrapped.setFetchDirection(direction);
}
public void setFetchSize(int rows) throws SQLException {
this.wrapped.setFetchSize(rows);
}
public void updateArray(int columnIndex, Array x) throws SQLException {
this.wrapped.updateArray(columnIndex, x);
}
public void updateArray(String columnName, Array x) throws SQLException {
this.wrapped.updateArray(columnName, x);
}
public void updateAsciiStream(int columnIndex, InputStream x, int length)
throws SQLException {
this.wrapped.updateAsciiStream(columnIndex, x, length);
}
public void updateAsciiStream(String columnName, InputStream x, int length)
throws SQLException {
this.wrapped.updateAsciiStream(columnName, x, length);
}
public void updateBigDecimal(int columnIndex, BigDecimal x)
throws SQLException {
this.wrapped.updateBigDecimal(columnIndex, x);
}
public void updateBigDecimal(String columnName, BigDecimal x)
throws SQLException {
this.wrapped.updateBigDecimal(columnName, x);
}
public void updateBinaryStream(int columnIndex, InputStream x, int length)
throws SQLException {
this.wrapped.updateBinaryStream(columnIndex, x, length);
}
public void updateBinaryStream(String columnName, InputStream x, int length)
throws SQLException {
this.wrapped.updateBinaryStream(columnName, x, length);
}
public void updateBlob(int columnIndex, Blob x) throws SQLException {
this.wrapped.updateBlob(columnIndex, x);
}
public void updateBlob(String columnName, Blob x) throws SQLException {
this.wrapped.updateBlob(columnName, x);
}
public void updateBoolean(int columnIndex, boolean x) throws SQLException {
this.wrapped.updateBoolean(columnIndex, x);
}
public void updateBoolean(String columnName, boolean x) throws SQLException {
this.wrapped.updateBoolean(columnName, x);
}
public void updateByte(int columnIndex, byte x) throws SQLException {
this.wrapped.updateByte(columnIndex, x);
}
public void updateByte(String columnName, byte x) throws SQLException {
this.wrapped.updateByte(columnName, x);
}
public void updateBytes(int columnIndex, byte[] x) throws SQLException {
this.wrapped.updateBytes(columnIndex, x);
}
public void updateBytes(String columnName, byte[] x) throws SQLException {
this.wrapped.updateBytes(columnName, x);
}
public void updateCharacterStream(int columnIndex, Reader x, int length)
throws SQLException {
this.wrapped.updateCharacterStream(columnIndex, x, length);
}
public void updateCharacterStream(String columnName, Reader reader, int length)
throws SQLException {
this.wrapped.updateCharacterStream(columnName, reader, length);
}
public void updateClob(int columnIndex, Clob x) throws SQLException {
this.wrapped.updateClob(columnIndex, x);
}
public void updateClob(String columnName, Clob x) throws SQLException {
this.wrapped.updateClob(columnName, x);
}
public void updateDate(int columnIndex, Date x) throws SQLException {
this.wrapped.updateDate(columnIndex, x);
}
public void updateDate(String columnName, Date x) throws SQLException {
this.wrapped.updateDate(columnName, x);
}
public void updateDouble(int columnIndex, double x) throws SQLException {
this.wrapped.updateDouble(columnIndex, x);
}
public void updateDouble(String columnName, double x) throws SQLException {
this.wrapped.updateDouble(columnName, x);
}
public void updateFloat(int columnIndex, float x) throws SQLException {
this.wrapped.updateFloat(columnIndex, x);
}
public void updateFloat(String columnName, float x) throws SQLException {
this.wrapped.updateFloat(columnName, x);
}
public void updateInt(int columnIndex, int x) throws SQLException {
this.wrapped.updateInt(columnIndex, x);
}
public void updateInt(String columnName, int x) throws SQLException {
this.wrapped.updateInt(columnName, x);
}
public void updateLong(int columnIndex, long x) throws SQLException {
this.wrapped.updateLong(columnIndex, x);
}
public void updateLong(String columnName, long x) throws SQLException {
this.wrapped.updateLong(columnName, x);
}
public void updateNull(int columnIndex) throws SQLException {
this.wrapped.updateNull(columnIndex);
}
public void updateNull(String columnName) throws SQLException {
this.wrapped.updateNull(columnName);
}
public void updateObject(int columnIndex, Object x) throws SQLException {
this.wrapped.updateObject(columnIndex, x);
}
public void updateObject(String columnName, Object x) throws SQLException {
this.wrapped.updateObject(columnName, x);
}
public void updateObject(int columnIndex, Object x, int scale)
throws SQLException {
this.wrapped.updateObject(columnIndex, x, scale);
}
public void updateObject(String columnName, Object x, int scale)
throws SQLException {
this.wrapped.updateObject(columnName, x, scale);
}
public void updateRef(int columnIndex, Ref x) throws SQLException {
this.wrapped.updateRef(columnIndex, x);
}
public void updateRef(String columnName, Ref x) throws SQLException {
this.wrapped.updateRef(columnName, x);
}
public void updateRow() throws SQLException {
this.wrapped.updateRow();
}
public void updateShort(int columnIndex, short x) throws SQLException {
this.wrapped.updateShort(columnIndex, x);
}
public void updateShort(String columnName, short x) throws SQLException {
this.wrapped.updateShort(columnName, x);
}
public void updateString(int columnIndex, String x) throws SQLException {
this.wrapped.updateString(columnIndex, x);
}
public void updateString(String columnName, String x) throws SQLException {
this.wrapped.updateString(columnName, x);
}
public void updateTime(int columnIndex, Time x) throws SQLException {
this.wrapped.updateTime(columnIndex, x);
}
public void updateTime(String columnName, Time x) throws SQLException {
this.wrapped.updateTime(columnName, x);
}
public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
this.wrapped.updateTimestamp(columnIndex, x);
}
public void updateTimestamp(String columnName, Timestamp x)
throws SQLException {
this.wrapped.updateTimestamp(columnName, x);
}
public boolean wasNull() throws SQLException {
return this.wrapped.wasNull();
}
}
这个是ResultSetMetaData的Decorate类:
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
public class ResultSetMetaDataWrapper implements ResultSetMetaData {
private ResultSetMetaData wrapped;
public ResultSetMetaDataWrapper(ResultSetMetaData wrapped) {
this.wrapped = wrapped;
}
public String getCatalogName(int column) throws SQLException {
return this.wrapped.getCatalogName(column);
}
public String getColumnClassName(int column) throws SQLException {
return this.wrapped.getColumnClassName(column);
}
public int getColumnCount() throws SQLException {
return this.wrapped.getColumnCount();
}
public int getColumnDisplaySize(int column) throws SQLException {
return this.wrapped.getColumnDisplaySize(column);
}
public String getColumnLabel(int column) throws SQLException {
return this.wrapped.getColumnLabel(column);
}
public String getColumnName(int column) throws SQLException {
return this.wrapped.getColumnName(column);
}
public int getColumnType(int column) throws SQLException {
return this.wrapped.getColumnType(column);
}
public String getColumnTypeName(int column) throws SQLException {
return this.wrapped.getColumnTypeName(column);
}
public int getPrecision(int column) throws SQLException {
return this.wrapped.getPrecision(column);
}
public int getScale(int column) throws SQLException {
int scale = this.wrapped.getScale(column);
return scale < 0 ? 0 : scale;
}
public String getSchemaName(int column) throws SQLException {
return this.wrapped.getSchemaName(column);
}
public String getTableName(int column) throws SQLException {
return this.wrapped.getTableName(column);
}
public boolean isAutoIncrement(int column) throws SQLException {
return this.wrapped.isAutoIncrement(column);
}
public boolean isCaseSensitive(int column) throws SQLException {
return wrapped.isCaseSensitive(column);
}
public boolean isCurrency(int column) throws SQLException {
return this.wrapped.isCurrency(column);
}
public boolean isDefinitelyWritable(int column) throws SQLException {
return this.wrapped.isDefinitelyWritable(column);
}
public int isNullable(int column) throws SQLException {
return this.wrapped.isNullable(column);
}
public boolean isReadOnly(int column) throws SQLException {
return this.wrapped.isReadOnly(column);
}
public boolean isSearchable(int column) throws SQLException {
return this.wrapped.isSearchable(column);
}
public boolean isSigned(int column) throws SQLException {
return this.wrapped.isSigned(column);
}
public boolean isWritable(int column) throws SQLException {
return wrapped.isWritable(column);
}
}
下面就是用spring的同学们了,在JdbcTemplate的queryForRowSet就会有出标题那个异常,于是,只能用query然后自己写extractor,具体代码如下,当然是可以偷懒啦,反正spring有实现了一个,我们改改就能用:
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import org.springframework.jdbc.core.SqlRowSetResultSetExtractor;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
public class CustomSqlRowSetResultSetExtractor
extends
SqlRowSetResultSetExtractor {
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
CachedRowSet rowSet = newCachedRowSet();
rowSet.populate(new ResultSetWrapper(rs));
return new ResultSetWrappingSqlRowSet(rowSet);
}
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/horsefaced/archive/2007/08/16/1746888.aspx
发表评论
-
剖析淘宝TDDL(TAOBAO DISTRIBUTE DATA LAYER)
2015-10-19 19:03 751剖析淘宝 TDDL ( TAOBAO DISTRIBUTE ... -
mysql/Java服务端对emoji的支持
2015-09-19 10:43 882前言: 最近开发的iOS项目因为需要用户文本的存储,自然就 ... -
mysql mysqldump只导出表结构或只导出数据的实现方法
2014-06-30 10:03 546mysql mysqldump只导出表结构或只导出数据的实 ... -
MySQL 绿色版安装方法教程
2014-01-20 19:22 544MySQL 绿色版安装方法教 ... -
mysql保存中文乱码的解决办法
2012-12-17 10:54 938现在继续用起了好久没用的mysql,又碰到了中文问题,客户端编 ... -
MySQL创建用户与授权
2012-12-16 16:13 852一, 创建用户: ... -
错误:ORA-28002: the password will expire within 7 days 解决方法
2012-03-12 09:12 2777今天在使用sqlplus时出现 ... -
Oracle建立DBLINK的详细步骤记录
2012-03-07 13:13 903测试条件: 假设某公司总部在北京,新疆有其下属的一个分公司。 ... -
有效创建oracle dblink的两种方式
2012-02-03 20:15 826两台不同的数据库服务器,从一台数据库服务器的一个用户读取另一台 ... -
把历史日期改成现在的日期,时刻不变
2011-12-17 15:07 9241. update 表名set 列名=to_dat ... -
Java框架数据库连接池比较(c3p0,dbcp和proxool)
2011-07-16 17:17 875现在常用的开源数据连 ... -
oracle的replace函数更新字段内容的例子
2011-04-09 13:22 2336把表格t_b_tablename中的字段sppic 中的内容中 ... -
Linux安装卸载Mysql数据库
2011-04-02 12:37 1065一、引言 想使用Linux已经很长时间了,由于没有硬性任 ... -
java.sql.SQLException: Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=18664
2011-02-11 16:28 4525java.sql.SQLException: Io 异常: C ... -
oracle中的exists 和not exists 用法详解
2010-12-28 11:32 1622一直对ORACLE的EXISTS用法不是很明白,从网上找了点资 ... -
pl sql developer中如何调试存储过程以及调试包中创建的存储过程
2010-12-22 10:44 2626学会使用PL/SQL Developer的调试功能,对于编 ... -
Mysql 复制表及结构
2010-11-26 11:35 1318Mysql 复制表及结构 1.创建新表create ... -
学习Oracle中Blob和Clob一点点心得
2010-11-02 14:36 999Blob是指二进制大对象也 ... -
oracle删除指定用户的原数据库,建立该用户的新数据库
2010-11-01 14:07 10171。用超级管理员账号登录 先删除指定用户: drop us ... -
drop user和drop user cascade的区别
2010-10-19 12:47 2253drop user ; 仅仅是删除用户, drop user ...
相关推荐
内容概要:本文主要探讨了SNS单模无芯光纤的仿真分析及其在通信和传感领域的应用潜力。首先介绍了模间干涉仿真的重要性,利用Rsoft beamprop模块模拟不同模式光在光纤中的传播情况,进而分析光纤的传输性能和模式特性。接着讨论了光纤传输特性的仿真,包括损耗、色散和模式耦合等参数的评估。随后,文章分析了光纤的结构特性,如折射率分布、包层和纤芯直径对性能的影响,并探讨了镀膜技术对光纤性能的提升作用。最后,进行了变形仿真分析,研究外部因素导致的光纤变形对其性能的影响。通过这些分析,为优化光纤设计提供了理论依据。 适合人群:从事光纤通信、光学工程及相关领域的研究人员和技术人员。 使用场景及目标:适用于需要深入了解SNS单模无芯光纤特性和优化设计的研究项目,旨在提高光纤性能并拓展其应用场景。 其他说明:本文不仅提供了详细的仿真方法和技术细节,还对未来的发展方向进行了展望,强调了SNS单模无芯光纤在未来通信和传感领域的重要地位。
发那科USM通讯程序socket-set
嵌入式八股文面试题库资料知识宝典-WIFI.zip
源码与image
内容概要:本文详细探讨了物流行业中路径规划与车辆路径优化(VRP)的问题,特别是针对冷链物流、带时间窗的车辆路径优化(VRPTW)、考虑充电桩的车辆路径优化(EVRP)以及多配送中心情况下的路径优化。文中不仅介绍了遗传算法、蚁群算法、粒子群算法等多种优化算法的理论背景,还提供了完整的MATLAB代码及注释,帮助读者理解这些算法的具体实现。此外,文章还讨论了如何通过MATLAB处理大量数据和复杂计算,以得出最优的路径方案。 适合人群:从事物流行业的研究人员和技术人员,尤其是对路径优化感兴趣的开发者和工程师。 使用场景及目标:适用于需要优化车辆路径的企业和个人,旨在提高配送效率、降低成本、确保按时交付货物。通过学习本文提供的算法和代码,读者可以在实际工作中应用这些优化方法,提升物流系统的性能。 其他说明:为了更好地理解和应用这些算法,建议读者参考相关文献和教程进行深入学习。同时,实际应用中还需根据具体情况进行参数调整和优化。
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_8.doc.zip
内容概要:本文介绍了基于灰狼优化算法(GWO)的城市路径规划优化问题(TSP),并通过Matlab实现了该算法。文章详细解释了GWO算法的工作原理,包括寻找猎物、围捕猎物和攻击猎物三个阶段,并提供了具体的代码示例。通过不断迭代优化路径,最终得到最优的城市路径规划方案。与传统TSP求解方法相比,GWO算法具有更好的全局搜索能力和较快的收敛速度,适用于复杂的城市环境。尽管如此,算法在面对大量城市节点时仍面临运算时间和参数设置的挑战。 适合人群:对路径规划、优化算法感兴趣的科研人员、学生以及从事交通规划的专业人士。 使用场景及目标:①研究和开发高效的路径规划算法;②优化城市交通系统,提升出行效率;③探索人工智能在交通领域的应用。 其他说明:文中提到的代码可以作为学习和研究的基础,但实际应用中需要根据具体情况调整算法参数和优化策略。
嵌入式八股文面试题库资料知识宝典-Intel3.zip
嵌入式八股文面试题库资料知识宝典-2019京东C++.zip
嵌入式八股文面试题库资料知识宝典-北京光桥科技有限公司面试题.zip
内容概要:本文详细探讨了十字形声子晶体的能带结构和传输特性。首先介绍了声子晶体作为新型周期性结构在物理学和工程学中的重要地位,特别是十字形声子晶体的独特结构特点。接着从散射体的形状、大小、排列周期等方面分析了其对能带结构的影响,并通过理论计算和仿真获得了能带图。随后讨论了十字形声子晶体的传输特性,即它对声波的调控能力,包括传播速度、模式和能量分布的变化。最后通过大量实验和仿真验证了理论分析的正确性,并得出结论指出散射体的材料、形状和排列方式对其性能有重大影响。 适合人群:从事物理学、材料科学、声学等相关领域的研究人员和技术人员。 使用场景及目标:适用于希望深入了解声子晶体尤其是十字形声子晶体能带与传输特性的科研工作者,旨在为相关领域的创新和发展提供理论支持和技术指导。 其他说明:文中还对未来的研究方向进行了展望,强调了声子晶体在未来多个领域的潜在应用价值。
嵌入式系统开发_USB主机控制器_Arduino兼容开源硬件_基于Mega32U4和MAX3421E芯片的USB设备扩展开发板_支持多种USB外设接入与控制的通用型嵌入式开发平台_
e2b8a-main.zip
少儿编程scratch项目源代码文件案例素材-火柴人跑酷(2).zip
内容概要:本文详细介绍了HarmonyOS分布式远程启动子系统,该系统作为HarmonyOS的重要组成部分,旨在打破设备间的界限,实现跨设备无缝启动、智能设备选择和数据同步与连续性等功能。通过分布式软总线和分布式数据管理技术,它能够快速、稳定地实现设备间的通信和数据同步,为用户提供便捷的操作体验。文章还探讨了该系统在智能家居、智能办公和教育等领域的应用场景,展示了其在提升效率和用户体验方面的巨大潜力。最后,文章展望了该系统的未来发展,强调其在技术优化和应用场景拓展上的无限可能性。 适合人群:对HarmonyOS及其分布式技术感兴趣的用户、开发者和行业从业者。 使用场景及目标:①理解HarmonyOS分布式远程启动子系统的工作原理和技术细节;②探索该系统在智能家居、智能办公和教育等领域的具体应用场景;③了解该系统为开发者提供的开发优势和实践要点。 其他说明:本文不仅介绍了HarmonyOS分布式远程启动子系统的核心技术和应用场景,还展望了其未来的发展方向。通过阅读本文,用户可以全面了解该系统如何通过技术创新提升设备间的协同能力和用户体验,为智能生活带来新的变革。
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_1.zip
少儿编程scratch项目源代码文件案例素材-激光反弹.zip
内容概要:本文详细介绍了COMSOL相控阵检测技术在有机玻璃斜楔上放置16阵元进行工件内部缺陷检测的方法。首先阐述了相控阵检测技术的基本原理,特别是通过控制各阵元的激发时间和相位来实现声波的聚焦和扫描。接着,重点解析了横孔缺陷的反射接收波,解释了波的折射现象及其背后的物理原因。最后,通过实例展示了COMSOL模拟声波传播过程的成功应用,验证了该技术的有效性和准确性。 适合人群:从事固体力学、无损检测领域的研究人员和技术人员,尤其是对相控阵检测技术和COMSOL仿真感兴趣的读者。 使用场景及目标:适用于需要精确检测工件内部缺陷的研究和工业应用场景,旨在提高检测精度和效率,确保产品质量和安全。 其他说明:文中提到的声速匹配现象有助于理解波在不同介质间的传播特性,这对优化检测参数设置有重要意义。
少儿编程scratch项目源代码文件案例素材-极速奔跑者.zip
嵌入式八股文面试题库资料知识宝典-微软_interview.zip