剛好我們做了一個,一個是本地pos,一個是遠(yuǎn)程pos,遠(yuǎn)程用oracle數(shù)據(jù)庫,本地用mysql數(shù)據(jù)庫??梢詳嗑W(wǎng)用也可以連網(wǎng)用,別35金幣了,十萬就行了。
成都創(chuàng)新互聯(lián)服務(wù)項目包括嶺東網(wǎng)站建設(shè)、嶺東網(wǎng)站制作、嶺東網(wǎng)頁制作以及嶺東網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,嶺東網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到嶺東省份的部分城市,未來相信會繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
System.out.println("您確定要退出小超市收銀管理系統(tǒng)(Y/N)?");
System.in();
char s=System.getInput();
switch(s){
case 'Y':System.exit(0);break;
case 'N':;
break;
}
可選中1個或多個下面的關(guān)鍵詞,搜索相關(guān)資料。也可直接點(diǎn)“搜索資料”搜索整個問題。
超市
java
代碼
首先你要了解mvc模式,其中有數(shù)據(jù)操作,即對數(shù)據(jù)庫的操作,連接數(shù)據(jù)庫,更刪查改,還有數(shù)據(jù)的顯示,即與用戶的交互,你可以用swing,有什么不懂可以繼續(xù)問我,如果可以把需求給我,我?guī)湍憧纯?/p>
你可以用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
{
// 創(chuàng)建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 發(fā)送請求的URL
* @return 服務(wù)器響應(yīng)字符串
* @throws Exception
*/
public static String a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"get/aRequest(String url)
throws Exception
{
// 創(chuàng)建HttpGet對象。
HttpGet get = new HttpGet(url);
// 發(fā)送GET請求
HttpResponse httpResponse = httpClient.execute(get);
// 如果服務(wù)器成功地返回響應(yīng)
if (httpResponse.getStatusLine()
.getStatusCode() == 200)
{
// 獲取服務(wù)器響應(yīng)字符串
String result = EntityUtils
.toString(httpResponse.getEntity());
return result;
}
return null;
}
/**
*
* @param url 發(fā)送請求的URL
* @param params 請求參數(shù)
* @return 服務(wù)器響應(yīng)字符串
* @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
{
// 創(chuàng)建Httpa href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9rjT4nWnLmvcsmW64nAwh0AP8IA3qPjfsn1bkrjKxmLKz0ZNzUjdCIZwsrBtEXh9GuA7EQhF9pywdQhPEUiqkIyN1IA-EUBtznjTdnWnYnWm1Pj6vnWRknH03" target="_blank" class="baidu-highlight"Post/a對象。
HttpPost post = new HttpPost(url);
// 如果傳遞參數(shù)個數(shù)比較多的話可以對傳遞的參數(shù)進(jìn)行封裝
ListNameValuePair params = new ArrayListNameValuePair();
for(String key : rawParams.keySet())
{
//封裝請求參數(shù)
params.add(new BasicNameValuePair(key , rawParams.get(key)));
}
// 設(shè)置請求參數(shù)
post.setEntity(new UrlEncodedFormEntity(
params, "gbk"));
// 發(fā)送POST請求
HttpResponse httpResponse = httpClient.execute(post);
// 如果服務(wù)器成功地返回響應(yīng)
if (httpResponse.getStatusLine()
.getStatusCode() == 200)
{
// 獲取服務(wù)器響應(yīng)字符串
String result = EntityUtils
.toString(httpResponse.getEntity());
return result;
}
return null;
}
}
小兄弟、你的程序也不算大程序、但是要做,至少也得3個小時、都在上班、哪有那么多時間給你做啊。知識是學(xué)著自己用的、你要是把這個項目做出來了、你就會進(jìn)步、會明白很多、其實(shí)java真的不難,何不自己試試呢?一步一步的做,加油,別低估了JAVA。