MySQL+servlet连接mysql 和android如何通信实现系统的登录功能

Android网络编程之一个Android下菜单系统模块的实现(开桌功能))(Android客户端+服务器端Servlet+Mysql)_-IT行业第一站
Android网络编程之一个Android下菜单系统模块的实现(开桌功能))(Android客户端+服务器端Servlet+Mysql)
Android网络编程之一个Android下菜单系统模块的实现(开桌功能))(Android客户端+服务器端Servlet+Mysql)
标题:Android网络编程之一个Android下菜单系统模块的实现(开桌功能))(Android客户端+服务器端Servlet+Mysql)
为了实现顾客下单的功能,需要在MySQL数据库的中设置一张表:ordertbl
然后在服务器端的Wireless项目下的com.moka.entity包中新建一个此表的对象类Order,就像登录部分的User一样:
用于封装OrderTbl表的实体类
*/ public class Order {
// 此订单编号
private int
// 下单时间
private String orderT
// 操作用户id
private int userId;
// 开桌台号
private int tableId;
// 此桌人数
private int personN
private int isP
// getters & setters .. 省略
同样,在对应包中建立对于ordertbl表的数据访问对象OrderDao与OrderDaoImpl,他们封装了所有对ordertbl的数据操作:
public interface OrderDao {
// 保存开桌信息
public int saveOrder(Order order);
// 保存菜表信息
public void saveOrderDetail(OrderDetail orderDetail);
// 更新桌号状态, 有人
public void updateTableStatus(int tableId);
// 更新桌号状态, 空位
public void updateTableStatus2(int orderId); }
public class OrderDaoImpl implements OrderDao {
public int saveOrder(Order order) {
// jdbc连接数据库准备工作
DBUtil util = new DBUtil();
Connection conn = util.openConnection();
// 插入数据库操作用
String saveOrderSql = &insert into ordertbl (orderTime, userId, tableId, personNum) values (?, ?, ?, ?)&;
PreparedStatement ps = null;
// 读取最新订单号操作用
Statement statement = null;
ResultSet orderIdSet = null;
ps = conn.prepareStatement(saveOrderSql);
ps.setString(1, order.getOrderTime());
ps.setInt(2, order.getUserId());
ps.setInt(3, order.getTableId());
ps.setInt(4, order.getPersonNum());
ps.executeUpdate();
// 返回此订单编号,因为id为自增主键,所以取其最大即为最新订单号
String returnOrderIdSql = &select max(id) as id from ordertbl&;
statement = conn.createStatement();
orderIdSet = statement.executeQuery(returnOrderIdSql);
if (orderIdSet.next()) {
// 获得订单号
int id = orderIdSet.getInt(1);
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (orderIdSet != null) {
orderIdSet.close();
orderIdSet = null;
if (statement != null) {
statement.close();
statement = null;
if (ps != null) {
ps.close();
ps = null;
if (conn != null) {
conn.close();
conn = null;
} catch (SQLException e) {
e.printStackTrace();
public void updateTableStatus(int tableId) {
// jdbc连接数据库准备工作
DBUtil util = new DBUtil();
Connection conn = util.openConnection();
// 更新此桌状态操作用
String updateSql = &update tabletbl set flag = 1 where id = ?&;
PreparedStatement ps = null;
// 此桌已订出, table表中flag置位
ps = conn.prepareStatement(updateSql);
ps.setInt(1, tableId);
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (ps != null) {
ps.close();
ps = null;
if (conn != null) {
conn.close();
conn = null;
} catch (SQLException e) {
e.printStackTrace();
public void updateTableStatusEx(int orderId) {
// 此处暂时不做操作
然后写StartTableServlet处理请求与响应:
public class StartTableServlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType(&text/html&);
// 获取输出打印流
PrintWriter pw = new PrintWriter(resp.getOutputStream());
// 读取请求中的order数据
String orderTime = req.getParameter(&orderTime&);
String userId = req.getParameter(&userId&);
String tableId = req.getParameter(&tableId&);
String personNum = req.getParameter(&personNum&);
// 将他们放入实例化的Order对象封装起来
Order order = new Order();
order.setOrderTime(orderTime);
order.setUserId(Integer.parseInt(userId));
order.setTableId(Integer.parseInt(tableId));
order.setPersonNum(Integer.parseInt(personNum));
// 定单数据存入MySQL端,更新对应桌号是否有人的状态,并获得返回的订单号传回客户端
OrderDao orderDao = new OrderDaoImpl();
int orderId = orderDao.saveOrder(order);
orderDao.updateTableStatus(Integer.parseInt(tableId));
pw.print(orderId);
pw.flush();
pw.close();
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doGet(req, resp);
最后注册新的servlet:
&servlet-name&StartTableServlet&/servlet-name&
&servlet-class&com.moka.servlet.StartTableServlet&/servlet-class&
&/servlet&
&servlet-mapping&
&servlet-name&StartTableServlet&/servlet-name&
&url-pattern&/servlet/StartTableServlet&/url-pattern&
&/servlet-mapping&
至此服务器端搭建完毕
延伸阅读:
热门搜索:
特色栏目:
类别推荐:两部android设备通过服务器转发实现通信简单demo
实现该通信的基本思路是:利用servlet服务器进行数据转发,利用android设备(手机)长连接本文已定时器来模拟长连接,实现了两部android手机内网通信。
1、作为终端的设备的设备主要是一个开机启动后就启动的一个服务,按照一定的时间间隔用http协议去请求服务器,查询服务器的状态,如果连接服务器,获得的相应是开启GPS信息收集,则在这个服务里开启已经安装在该android手机上的GPS信息收集APP,然后通过Http的GET方式源源不断的向服务器传递GPS信息。
关键代码如下:
public class RunningServiceByPowerOn extends Service {
private SharedPreferences mP
public RunningServiceByPowerOn() {
// TODO Auto-generated constructor stub
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
mPreferences=getSharedPreferences("Config",MODE_PRIVATE);
timerTaskforGpsSwitch();
* 每隔5s查询一次
private void timerTaskforGpsSwitch(){
Timer timer = new Timer();
Date d2 = new Date(System.currentTimeMillis());
timer.schedule(new TimerTask() {
public void run() {
Log.i("是否开启GPS收集","定时器开启");
String spec="http://"+ConentValues.serverIp+":8080/MyServer/StartAction?mAction=find_gps_switcher1";
String str=
url = new URL(spec);
str=HttpToServierUtils.connect(url);
if(str!=null&&str.equals("GPS_start")){
//开启GPS服务
Log.i("是否开启GPS收集","开启GPS信息收集服务");
//Toast.makeText(getApplicationContext(),"开启GPS信息收集服务",0).show();
//开启一个应用
if(mPreferences.getBoolean("isStop", true)){
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
ComponentName cn = new ComponentName("com.yqq.gpsinfolocationstartreceiver", "com.yqq.gpsinfolocationstartreceiver.MainActivity");
intent.setComponent(cn);
startActivity(intent);
mPreferences.edit().putBoolean("isStop", false).commit();
if(str!=null&&str.equals("GPS_stop")){
mPreferences.edit().putBoolean("isStop",true).commit();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
},d2, 5000);
Gps信息收集的关键代码:
public class GpsInfoCollectionService extends Service {
private Boolean D=
private GPSinfoDao mGpSinfoD
private LocationManager mLocationM
private Location mL
public GpsInfoCollectionService() {
public IBinder onBind(Intent intent) {
Log.i("GPS服务数据收集","IBinder()");
public void onCreate() {
Log.i("GPS服务数据收集","onCreate()");
super.onCreate();
mLocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);//获取精确的位置.
criteria.setAltitudeRequired(true);
criteria.setBearingRequired(true);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_LOW);
criteria.setSpeedRequired(true);
//判断GPS是否正常启动
if(!mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
Toast.makeText(this, "请开启GPS导航...", Toast.LENGTH_SHORT).show();
//返回开启GPS导航设置界面
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
mGpSinfoDao=new GPSinfoDao(getApplicationContext());
timerTaskforGpsSwitch();
public int onStartCommand(Intent intent, int flags, int startId) {
Log.i("GPS服务数据收集","onStartCommand()");
provider = mLocationManager.getBestProvider(criteria, true);
Log.i("<<<<",provider);
mLocationManager.requestLocationUpdates(provider, 300, 0.01f, new LocationListener() {
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
public void onLocationChanged(Location location) {
if(location==null){
//updateLocation(location);
mLocation=
new AsyncTask() {
private String str=
protected Void doInBackground(Void... params) {
String height=mLocation.getAltitude()+"";
String longitude=mLocation.getLongitude()+"";
String latitude=mLocation.getLatitude()+"";
String name="Test";
//http://172.22.122.1:8080/MyServer/MyTest?longitude=111&latitude=222&height=1000&name=Test
//通过http向服务器传递数据
String spec="http://"+ConentValues.serverIp+":8080/MyServer/MyTest?longitude="+longitude+"&latitude="+latitude+"&height="+height+"&name="+
url = new URL(spec);
str=HttpToServierUtils.connect(url);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
/*GpsInfo info=new GpsInfo();
info.setLongitude(longitude+"");
info.setLatitude(latitude+"");
info.setHeight(height+"");
mGpSinfoDao.addGpsInfo(info);
protected void onPostExecute(Void result) {
Toast.makeText(getApplicationContext(), str,0).show();
}.execute();
return super.onStartCommand(intent, flags, startId);
public void onDestroy() {
Log.i("GPS服务数据收集","onDestroy()");
mGpSinfoDao=
mLocationManager=
mLocation=
super.onDestroy();
* 每隔5s查询一次
private void timerTaskforGpsSwitch(){
Timer timer = new Timer();
Date d2 = new Date(System.currentTimeMillis());
timer.schedule(new TimerTask() {
public void run() {
Log.i("终端信息收集","定时器开启");
String spec="http://"+ConentValues.serverIp+":8080/MyServer/MyTest?mAction=find_gps_switcher";
String str=
url = new URL(spec);
str=HttpToServierUtils.connect(url);
/* if(str!=null&&str.equals("GPS_start")){
//开启GPS服务
Log.i("终端信息收集","开启GPS信息收集服务");
//Toast.makeText(getApplicationContext(),"开启GPS信息收集服务",0).show();
if(str!=null&&str.equals("GPS_stop")){
Log.i("终端信息收集","停止GPS信息收集服务");
//Toast.makeText(getApplicationContext(),"关闭GPS信息收集服务",0).show();
//关闭GPS服务
//getSharedPreferences("Config",MODE_PRIVATE).edit().putBoolean("isStarted", false).commit();
stopSelf();
System.exit(0);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
},d2, 5000);
2、服务端利用servlet来处理各自的请求和响应
关键代码:
(1)处理GPS信息上传到服务器的servlet
public class MyTest extends HttpServlet {
//private List
private GpsI
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setContentType("text/charset=utf-8");
resp.setCharacterEncoding("utf-8");
PrintWriter
out=resp.getWriter();
String nameAction=(String)req.getAttribute("nameAction");
//String spec="http://"+ConentValues.serverIp+":8080/MyServer/MyTest?longitude="+longitude+"&latitude="+latitude+"&height="+
String longitude=req.getParameter("longitude");
String latitude=req.getParameter("latitude");
String height=req.getParameter("height");
String name=req.getParameter("name");
String mAction=req.getParameter("mAction");
//查询服务器端数据库并获得返回值
if(mAction!=null&&mAction.equals("find_gps_switcher")){
System.out.println("定时器服务查询:"+mAction);
String result=DbUtis.getGPSStaus();
if(result!=null&&result.equals("start_gps")){
out.write("GPS_start");
out.flush();
if(result!=null&&result.equals("end_gps")){
out.write("GPS_stop");
out.flush();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//上传的服务器的数据
if(longitude!=null&&latitude!=null&&height!=null){
info=new GpsInfo();
info.setLongitude(longitude);
info.setLatitude(latitude);
info.setHeight(height);
info.setName(name);
DbUtis.insertGpsInfos(info);
System.out.println("游客终端上传的数据:"+info.toString());
out.write("GPS数据已经上传到服务器");
out.flush();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
/*if(out!=null){
out.close();
* 处理gps开关信息的servlet
* @author yqq_coder
public class GpsOnOffAction extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
//开启GPS收集
String gpsSend=req.getParameter("namegpsend");
//关闭GPS终端收集服务
String gpsstop=req.getParameter("namegpsstop");
PrintWriter out=resp.getWriter();
//开启GPS收集
if(gpsSend!=null&&gpsSend.equals("start_gps")){
System.out.println("GPS信息收集指令:"+gpsSend);
out.write("终端GPS信息收集开启");
DbUtis.deleteGpsSatus();
DbUtis.insertGpsSatus("start_gps");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// req.setAttribute("nameAction", "GPS_start");
// req.getRequestDispatcher("/MyTest").forward(req, resp);
//关闭GPS终端收集服务
if(gpsstop!=null&&gpsstop.equals("end_gps")){
System.out.println("GPS信息关闭指令:"+gpsstop);
out.write("终端GPS信息收集关闭");
DbUtis.deleteGpsSatus();
DbUtis.insertGpsSatus("end_gps");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//req.setAttribute("nameAction", "GPS_stop");
//req.getRequestDispatcher("/MyTest").forward(req, resp);
out.flush();
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
super.service(req, resp);
* 查询GPS信息
* @author yqq_coder
public class QurAction extends HttpServlet {
private JSONA
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
//轨迹显示参数
String s = req.getParameter("namereq");
PrintWriter out=resp.getWriter();
//http://172.22.122.1:8080/MyServer/MyTest?namereq=Test
if(s!=null){
out=resp.getWriter();
System.out.println(s);
infos=DbUtis.getData(s);
System.out.println("返回客户端的数据:"+infos.toString());
out.write(infos.toString());
out.flush();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(out!=null){
out.close();
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(req, resp);
* 处理是否开启GPS信息收集的servlet
* @author yqq_coder
public class StartAction extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setContentType("text/charset=utf-8");
resp.setCharacterEncoding("utf-8");
PrintWriter
out=resp.getWriter();
String nameAction=(String)req.getAttribute("nameAction");
String mAction=req.getParameter("mAction");
//查询服务器端数据库并获得返回值
if(mAction!=null&&mAction.equals("find_gps_switcher1")){
System.out.println("定时器服务查询:"+mAction);
String result=DbUtis.getGPSStaus();
if(result!=null&&result.equals("start_gps")){
out.write("GPS_start");
out.flush();
if(result!=null&&result.equals("end_gps")){
out.write("GPS_stop");
out.flush();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(out!=null){
out.close();
数据库工具类:
import java.sql.DriverM
import java.sql.ResultS
import java.sql.SQLE
import java.sql.C
import java.sql.PreparedS
import java.sql.S
import java.util.ArrayL
import java.util.L
import org.json.JSONA
import org.json.JSONE
import org.json.JSONO
public class DbUtis {
private static String ip="192.168.1.134";
private static C
public static JSONArray getData(String name) throws SQLException {
List infos = new ArrayList();
JSONArray array = new JSONArray();
GpsInfo info =
JSONObject jsonObject =
PreparedStatement pstmt =
ResultSet rs =
// 连接数据库
Class.forName("com.mysql.jdbc.Driver");
// 链接数据库
DriverManager.getConnection(
"jdbc:mysql://"+ip+":3306/test", "root", "admin");
// Statement stmt =(Statement) conn.prepareStatement("");
String sql="select name,longitude,latitude from gpsinfos where name=?";
conn.prepareStatement(sql);
pstmt.setString(1, name);
rs = pstmt.executeQuery();
// 从结果集里取值
//System.out.println(rs.getRow());
while (rs.next()) {
// info=new GpsInfo();
// info.setLatitude(rs.getString(0));//纬度
// info.setLongitude(rs.getString(1));
// infos.add(info);
jsonObject = new JSONObject();
jsonObject.put("name", rs.getString("name"));
jsonObject.put("longitude", rs.getString("longitude"));
jsonObject.put("latitude", rs.getString("latitude"));
array.put(jsonObject);
jsonObject=
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
if (rs != null) {
rs.close();
if(pstmt!=null)
pstmt.close();
if (conn != null) {
conn.close();
public static String getGPSStaus() throws SQLException {
String result=
PreparedStatement pstmt =
ResultSet rs =
// 连接数据库
Class.forName("com.mysql.jdbc.Driver");
// 链接数据库
DriverManager.getConnection(
"jdbc:mysql://"+ip+":3306/test", "root", "admin");
// Statement stmt =(Statement) conn.prepareStatement("");
String sql="select gps_staus from gps_switcher ";
conn.prepareStatement(sql);
rs = pstmt.executeQuery();
// 从结果集里取值
//System.out.println(rs.getRow());
while (rs.next()) {
result=rs.getString("gps_staus");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
if (rs != null) {
rs.close();
if(pstmt!=null)
pstmt.close();
if (conn != null) {
conn.close();
public static void insertGpsInfos(GpsInfo info) throws SQLException{
PreparedStatement pstmt = // 数据库表达式
ResultSet rs = // 结果集
/*加载驱动*/
//192.168.173.1
Class.forName("com.mysql.jdbc.Driver");
/*连接到数据库*/
DriverManager.getConnection(
"jdbc:mysql://"+ip+":3306/test", "root", "admin");
String sql = "insert into gpsinfos (name,longitude,latitude) values (?,?,?)";
/* 获取表达式*/
conn.prepareStatement(sql);
pstmt.setString(1,info.getName());
pstmt.setString(2, info.getLongitude());
pstmt.setString(3, info.getLatitude());
插入数据*/
pstmt.execute();
/* 执行SQL*/
rs = pstmt.executeQuery("select * from gpsinfos");
/* 查看里面的数据*/
while (rs.next()) {
System.out.println("插入的数据姓名=" + rs.getString("name"));
System.out.println("插入的数据经度=" + rs.getString("longitude"));
System.out.println("插入的数据纬度=" + rs.getString("latitude"));
} catch (SQLException ex) {
ex.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(rs!=null){
rs.close();
if(pstmt!=null)
pstmt.close();
if(conn!=null){
conn.close();
public static void insertGpsSatus(String staus) throws SQLException{
PreparedStatement pstmt = // 数据库表达式
ResultSet rs = // 结果集
/*加载驱动*/
//192.168.173.1
Class.forName("com.mysql.jdbc.Driver");
/*连接到数据库*/
DriverManager.getConnection(
"jdbc:mysql://"+ip+":3306/test", "root", "admin");
String sql = "insert into gps_switcher (gps_staus) values (?)";
/* 获取表达式*/
conn.prepareStatement(sql);
pstmt.setString(1,staus);
插入数据*/
pstmt.execute();
/* 执行SQL*/
rs = pstmt.executeQuery("select * from gps_switcher");
/* 查看里面的数据*/
while (rs.next()) {
System.out.println("插入的数据GPS状态=" + rs.getString("gps_staus"));
} catch (SQLException ex) {
ex.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(rs!=null){
rs.close();
if(pstmt!=null)
pstmt.close();
if(conn!=null){
conn.close();
public static void deleteGpsSatus() throws SQLException{
PreparedStatement pstmt = // 数据库表达式
ResultSet rs = // 结果集
/*加载驱动*/
//192.168.173.1
Class.forName("com.mysql.jdbc.Driver");
/*连接到数据库*/
DriverManager.getConnection(
"jdbc:mysql://"+ip+":3306/test", "root", "admin");
String sql="delete from gps_switcher";
conn.prepareStatement(sql);
pstmt.execute();
} catch (SQLException ex) {
ex.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(rs!=null){
rs.close();
if(pstmt!=null)
pstmt.close();
if(conn!=null){
conn.close();
public static void createTable() throws SQLException{
//Class.forName("com.mysql.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://"+ip+":3306/test","root","admin");
String sql = "CREATE TABLE gpsinfos (id int primary key auto_increment, name varchar(64) not null, longitude varchar(256) not null , latitude varchar(256) not null );";
//CREATE TABLE gpsinfos (id int primary key auto_increment, gps_staus varchar(16) not null)
//gps_switcher(id int primary key auto_increment, gps_staus varchar(16) not null unique)
PreparedStatement pstmt =
conn.prepareStatement(sql);
pstmt.executeUpdate();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
public static void main(String[]args) throws SQLException{
createTable();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//insertGpsInfos(new GpsInfo("小强","","222"));
System.out.println(DbUtis.getData("Lihua"));
控制端主要是发送几个GET方式的请求,这里就不再贴代码了。
几个请求:
"http://"&#43;ConentValues.serverIp&#43;":8080/MyServer/MyTest?mAction=find_gps_switcher";
"http://"&#43;ConentValues.serverIp&#43;":8080/MyServer/StartAction?mAction=find_gps_switcher1";
http://172.22.122.1:8080/MyServer/MyTest?longitude=111&latitude=222&height=1000&name=Test
http://172.22.122.1:8080/MyServer/MyTest?namereq=Test
demo地址:http://download.csdn.net/detail/u09931
您对本文章有什么意见或着疑问吗?请到您的关注和建议是我们前行的参考和动力&&
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。

我要回帖

更多关于 servlet连接mysql 的文章

 

随机推荐