技术标签: web
package DB;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import JavaBean.mapAddress_Info;
/*
* 查询 ”地址数据库“
* 这个类主要功能是为了方便查询 mapaddress 中 addressNum 对于的 地址编码
*
* */
public class DataBase_map_address {
public static final String DB_driver = "com.mysql.jdbc.Driver";
public static final String DB_url ="jdbc:mysql://localhost:3306/test?characterEncoding=utf8";
public static final String DB_user ="root";
public static final String DB_pass ="root";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs =null;
public DataBase_map_address() throws ClassNotFoundException, SQLException{
Class.forName(this.DB_driver);
this.conn = DriverManager.getConnection(this.DB_url,this.DB_user,this.DB_pass);
}
/*
* 根据地址编码 得到 地址信息
* */
public String getAddress(String addressNum) throws SQLException{
String sql ="select * from mapaddress where addressNum=? ";
pstmt=conn.prepareStatement(sql);
this.pstmt.setString(1, addressNum);
this.rs = this.pstmt.executeQuery();
if(rs.next()){
return rs.getString(3);
}else{
return null;
}
}
/*
* 检查 地址编码是否存在
* */
public boolean checkAddressNum(String addressNum) throws SQLException{
String sql ="select * from mapaddress where addressNum=? ";
pstmt=conn.prepareStatement(sql);
this.pstmt.setString(1, addressNum);
this.rs = this.pstmt.executeQuery();
if(rs.next()){
return true;
}else{
return false;
}
}
/*
* 获取得到mapaddress数据库中数据的全部 编号。名称。经度。纬度
* */
public List<mapAddress_Info> getMapAddress_Info() throws SQLException{
List<mapAddress_Info> list = new ArrayList<mapAddress_Info>();
String sql = "select * from mapaddress";
this.pstmt=this.conn.prepareStatement(sql);
this.rs = this.pstmt.executeQuery();
while(rs.next()){
mapAddress_Info mapAddress = new mapAddress_Info();
mapAddress.setMapAddressNum(rs.getString(2));
mapAddress.setMapAddressName(rs.getString(3));
mapAddress.setLon(rs.getString(4));
mapAddress.setLat(rs.getString(5));
list.add(mapAddress);
}
return list;
}
/*
* 添加地理数据
* */
public boolean addMapAddress(String mapAddressNum, String mapAddressName, String mapAddressLon, String mapAddressLat) throws SQLException{
//String sql="insert into mapaddress (addressNum,address,longitude,latitude) values (mapAddressNum,mapAddressName,mapAddressLon,mapAddressLat)" ;
String sql="insert into mapaddress (addressNum,address,longitude,latitude) values (?,?,?,?)" ;
this.pstmt = this.conn.prepareStatement(sql);
this.pstmt.setString(1, mapAddressNum);
this.pstmt.setString(2, mapAddressName);
this.pstmt.setString(3, mapAddressLon);
this.pstmt.setString(4, mapAddressLat);
this.pstmt.executeUpdate();
//this.pstmt.executeQuery();
return true;
}
/*
* 删除数据
* */
public boolean deleteMapAddress(String mapAddressNum) throws SQLException{
String sql = "delete from mapaddress where addressNum = ?";
this.pstmt = this.conn.prepareStatement(sql);
this.pstmt.setString(1, mapAddressNum);
this.pstmt.executeUpdate();
return false;
}
}
#pragma once// tv2.h -- Tv and Remote classes#ifndef __TV2_H__#define __TV2_H__class Tv{public: friend class Remote; // Remote can access Tv private parts enum { Off, On }; enum { MinVal, M...
小程序结构目录小程序语法导航栏标题文本navigationBarTitleTextjs语法事件bindtap 点击事页面的初始化数据 data: { msg:"初始化测试数据" }事件绑定事件分类冒泡事件子节点向父节点传递的事件就是冒泡事件非冒泡事件表单事件和自定义事件通常是非冒泡事件绑定事件bind绑定:事件绑定不会阻止事件向上冒泡bindtapcatch绑定:事件绑定可以阻止冒泡事件向上冒泡catchtap
现在的笔记本越来越先进了,都自带win7系统了,个人感觉win7不怎么样,优点有一大堆,但就是慢,这一点就受不了,所以打算装xp了,联想z470A的本,在官网找到了驱动,就开始安装系统了,心想:有了驱动,还不好办。开始用xp系统盘(纯净版)装系统,本打算用u盘装来着,但捣鼓了半天也没成功,倒是做的U盘winPE能进去,但是装系统还是失败,毫无反应,只能用光盘装了。 ...
随着互联网信息技术以及智能技术的发展,物联网和智能设备将会有什么样的发展?将为行业及企业带来哪些挑战和机遇?物联网(iot)给公司带来了无限遐想的商业机会,行业内的各种规则都将被它改写,有相关数据表示:到了2020年,有将近2000万的数字设备都将纳入到物联网当中,而物联网行业中产品制造商和服务提供商所实现的收入将达到3000亿美金。通过整合传感器、数...
/// /// 计算两个时间段相差天数 /// /// 开始时间(不带时分秒) /// 结束时间(不带时分秒) /// public static int GetTimeDifference(DateTime begintime, DateTime endtime)
Nature:复杂菌群空间分布研究Highly multiplexed spatial mapping of microbial communities(图1:文章信息简介。图片来源:截图...
在说什么是数据资产之前,我们需要先明确什么是数据?数据就是数值,可以是信息在某个时点的结果值,如数字、文本、图像、声音等都可以是数据,那么数据就是信息的载体,以数据库、文档、图形、视频等形式存在,这些都是企业的资源,数据类型的资源。资产是可以带来收益的那部分资源,那么数据资产就是企业拥有能给企业带来收益的数据资源,那么数据资产的属性特征有:数据资产是具有价值的,也就是有价值的数据资源才可以是数据资产。没价值的数据资源,通过数据采集、整理、汇总等加工处理后形成具有可以为企业带来直接或间接经济价值的数据
最近在做matlab 编好程序最后移植到linux qt上1、第一个遇到的问题:无论怎么弄,都显示打包期间出错,原因:没有安装与matab版本对应的vs版本,具体matlab支持的vs脚本,可以在日志中看或者,重新安装相应版本的vs就可以了。参考:(14条消息) Window上,Matlab安装libsvm,libsvmtrain.mexw64无效,mex-setup 失败_TIME_LEAF的博客-程序员宝宝https://blog.csdn.net/yanhuatangtang/ar.
经常遇到页面显示文字乱码问题,大多数是由于字符编码问题导致。通常设置[code="java"][/code]在页面头指定字符charset=utf-8等编码方式。[color=blue]Always declare the encoding of your document. Use the HTTP header if you can. Always use an in-docu...
屈耀摘 要:地面区域控制器(ZC)作为CBTC系统的核心地面设备,剖析其功能、工作原理及外部通信,对我们深化认知,学习和理解有着极为重要意义。关键词:区域控制器;ZC;CBTC中图分类号:U284.48 文献标志码:A 文章编号:2095-2945(2019)25-0069-04Abstract: Zone Controller (ZC) is the core gr...
osgViewer::Viewer首先添加osgView::StatsHandler负责统计信息的处理osgView::StatsHandle中的handle函数具体负责s键的响应和切换。osgViewer/StatsHandler.cppbool StatsHandler::handle(const osgGA::GUIEventAdapter&amp; ea, osgGA::G...
数组基本概念//数组:一组有序的数据 //数组的作用:可以一次性存储多个数据 //数组的定义: /** *1、通过构造函数的方式创建数组 *语法: * var 数组名 = new Array(); * var array = new Array();//定义了一个数组 * 数组的名字如果直接输出 那么 就可以把数组中的数据显示出来 如果没有数据 就看不到数据 * var 数组名 = new Array(长度); * 如果数组中没有数据 但是有长度-------