十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
刚好我们做了一个,一个是本地pos,一个是远程pos,远程用oracle数据库,本地用mysql数据库。可以断网用也可以连网用,别35金币了,十万就行了。
成都创新互联服务项目包括岭东网站建设、岭东网站制作、岭东网页制作以及岭东网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,岭东网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到岭东省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
System.out.println("您确定要退出小超市收银管理系统(Y/N)?");
System.in();
char s=System.getInput();
switch(s){
case 'Y':System.exit(0);break;
case 'N':;
break;
}
可选中1个或多个下面的关键词,搜索相关资料。也可直接点“搜索资料”搜索整个问题。
超市
java
代码
首先你要了解mvc模式,其中有数据操作,即对数据库的操作,连接数据库,更删查改,还有数据的显示,即与用户的交互,你可以用swing,有什么不懂可以继续问我,如果可以把需求给我,我帮你看看
你可以用Apache的HTTPClient访问:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"Url/aEncodedFormEntity;
import org.apache.http.client.methods.Httpa href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"Get/a;
import org.apache.http.client.methods.Httpa href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"Post/a;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
public class HttpUtil
{
// 创建HttpClient对象
public static HttpClient httpClient = new DefaultHttpClient();
public static final String BASE_a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"URL/a =
"a href="";" tara href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"get/a="_blank"";/a
/**
*
* @param a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"url/a 发送请求的URL
* @return 服务器响应字符串
* @throws Exception
*/
public static String a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"get/aRequest(String url)
throws Exception
{
// 创建HttpGet对象。
HttpGet get = new HttpGet(url);
// 发送GET请求
HttpResponse httpResponse = httpClient.execute(get);
// 如果服务器成功地返回响应
if (httpResponse.getStatusLine()
.getStatusCode() == 200)
{
// 获取服务器响应字符串
String result = EntityUtils
.toString(httpResponse.getEntity());
return result;
}
return null;
}
/**
*
* @param url 发送请求的URL
* @param params 请求参数
* @return 服务器响应字符串
* @throws Exception
*/
public static String a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"post/aRequest(String url
, MapString ,String rawParams)throws Exception
{
// 创建Httpa href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"Post/a对象。
HttpPost post = new HttpPost(url);
// 如果传递参数个数比较多的话可以对传递的参数进行封装
ListNameValuePair params = new ArrayListNameValuePair();
for(String key : rawParams.keySet())
{
//封装请求参数
params.add(new BasicNameValuePair(key , rawParams.get(key)));
}
// 设置请求参数
post.setEntity(new UrlEncodedFormEntity(
params, "gbk"));
// 发送POST请求
HttpResponse httpResponse = httpClient.execute(post);
// 如果服务器成功地返回响应
if (httpResponse.getStatusLine()
.getStatusCode() == 200)
{
// 获取服务器响应字符串
String result = EntityUtils
.toString(httpResponse.getEntity());
return result;
}
return null;
}
}
小兄弟、你的程序也不算大程序、但是要做,至少也得3个小时、都在上班、哪有那么多时间给你做啊。知识是学着自己用的、你要是把这个项目做出来了、你就会进步、会明白很多、其实java真的不难,何不自己试试呢?一步一步的做,加油,别低估了JAVA。