java web项目,怎么将sqlserver的表显示在网页上?附的图片上表格没显示出来,怎么解决?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java web项目,怎么将sqlserver的表显示在网页上?附的图片上表格没显示出来,怎么解决?相关的知识,希望对你有一定的参考价值。
前端代码如图。后台:public List<DMswBean> getDMAllA(String burucode, String dSname,String time1, String time2,int StartIndex,int pageSize) throws Exception List<DMswBean> list = new ArrayList<DMswBean>();Connection conn = null;PreparedStatement pstmt = null;ResultSet rs = null;String sqlString = "";sqlString = "select * from (SELECT V_site_data.id, site_station.Sn as Sn, Sname,[Datatime] FROM site_station,V_site_data where site_station.Sn=V_site_data.Sn ";sqlString +=(time1 != null && !"".equals(time1.trim())&&!"null".equals(time1.trim()))?" and [Datatime] > '" + time1.trim() + "'":"";sqlString +=(time2 != null && !"".equals(time2.trim())&&!"null".equals(time2.trim()))?" and [Datatime]< '" + time2.trim() + "'":""; sqlString +=(burucode!= null && !"".equals(burucode.trim())&& !"null".equals(burucode.trim()))?" and burucode='" + burucode.trim() +"'":"";sqlString +=(dSname != null && !"".equals(dSname.trim())&&(!"null".equals(dSname.trim())))?" and site_station.Sname like '%" + dSname.trim() + "%'":"";sqlString += ") t order by t.Datatime offset " + StartIndex + " rows fetch next " + pageSize +" rows only;"; try conn = DButil.getConnection(); pstmt = conn.prepareStatement(sqlString); rs = pstmt.executeQuery(); DMswBean db = null; DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); while (rs.next()) db = new DMswBean(); String sim = rs.getString("Sn"); String area = rs.getString("Sname"); String ttime = df.format(rs.getTimestamp("Datatime")); db.setSim(sim); db.setArea(area); db.setTtime(ttime); list.add(db); catch (SQLException e) e.printStackTrace(); finally conn.close(); pstmt.close(); rs.close(); return list;
参考技术A 你前台代码呢追问我一共附了三张图,前台代码在后两张上面
JAVA远程的webserver
我想使用一个实例接口类读取本地文档成为字符串,传给对方,让对方在解析读出来
需要怎么配置XML呢?
如果你用xml传输数据,方案如下:
这个你要写DTD。双方都按照这个DTD规范来解析XML就可以。追问
使用webserver
使用webserver有。将一个xml转换为一个字符串,放在一个接口里,传给对方,让对方解析出来
追答webserver是web服务器。是web service?
参考技术A 这样的那么说你本地的程序是 服务端了,那么你需要的是服务端的一个发布一个webserver服务的接口了,<bean id="webServiceBean" class="com.rn.webservice.server.impl.DataAndInfoImpl" />
<bean id="statisticalWebServiceBean" class="com.rn.webservice.server.impl.DataStatisticalImpl" />
<bean id="segmentationReportWebServiceBean" class="com.rn.webservice.server.impl.SegmentationReportImpl" />
<bean id="mobilePushBean" class="com.rn.webservice.server.impl.MobilePushBean" />
<jaxws:server id="mobilePushInfo" address="/MobilePushServices"
serviceClass="com.rn.webservice.server.IMobilePushBean">
<jaxws:serviceBean>
<ref bean="mobilePushBean"/>
</jaxws:serviceBean>
</jaxws:server>
<jaxws:server id="dataAndInfo" address="/DataAndInfoServices"
serviceClass="com.rn.webservice.server.IDataAndInfo">
<jaxws:serviceBean>
<ref bean="webServiceBean"/>
</jaxws:serviceBean>
</jaxws:server>
<jaxws:server id="dataStatistical" address="/DataStatisticalServices"
serviceClass="com.rn.webservice.server.IDataStatistical">
<jaxws:serviceBean>
<ref bean="statisticalWebServiceBean"/>
</jaxws:serviceBean>
</jaxws:server>
<jaxws:server id="segmentationReport" address="/SegmentationReportServices"
serviceClass="com.rn.webservice.server.ISegmentationReport">
<jaxws:serviceBean>
<ref bean="segmentationReportWebServiceBean"/>
</jaxws:serviceBean>
</jaxws:server>
然后接口上面我用的注解 列:
@WebService
@SOAPBinding(style = Style.RPC)
public interface ISegmentationReport 本回答被提问者和网友采纳
以上是关于java web项目,怎么将sqlserver的表显示在网页上?附的图片上表格没显示出来,怎么解决?的主要内容,如果未能解决你的问题,请参考以下文章