安卓已经连接好了SQL sever数据库,可以查询到指定字段,在数据库里用本地图片的存储路径存储的图片,想知道安卓那边如何调用
String result = "";
this.phone=phone;
try{
Class.forName(driverName); //jdk版本6.0以上可以省略这句话
con= DriverManager.getConnection(dbURL,userName,userPwd);
String sql="select * from Customer where Phone ="+phone;
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(sql);
while(rs.next()){
if(rs.getString("Phone").equals(phone)){
result="1";
}
}
rs.close();
st.close();
con.close();
// System.out.println("连接数据库成功");
}
catch(Exception e){
e.printStackTrace();
}
return result;
}
无
无
可以存储调用和显示