導航:首頁 > 編程語言 > java進存管理系統

java進存管理系統

發布時間:2024-01-28 20:15:17

1. java做個XX管理系統能不能不用資料庫而是用文件輸入輸出流來存儲數據為什麼

可以的 一般用到資料庫都是稍微有點規模的項目
如果你做的只是個很小的項目 比如用資料庫也只是兩三張表就可以解決的 那可以考慮用XML文件來實現數據的存取
沒有為什麼 就是這樣的 小的程序 可以用XML等文件來管理數據
有點規模的可以用mySql SqlServer等資料庫來管理數據
大的項目可以用Oracle
這都是比較正常的情況 就像有錢人開的是賓士寶馬 沒錢人開的是QQ 或者像我一樣坐公交 騎自行車。。。
項目在設計的前期就要考慮到數據管理這一塊如何實現 為的是讓項目組開發更有效率 讓程序運行更加完美 最重要的是 讓資金預算達到最大利益化 打個比方 如果開發小的項目 用Oracle去管理數據 第一 大材小用 沒有必要 可恥的浪費 第二 老闆會開了你 因為這樣的小項目本就賺不了多少錢 你還大手大腳的花老闆的錢去用oracle 嘖嘖。。。 第三 整個程序開發後的效率並不見得比用XML或者小資料庫運行的好
用一句話說 :「我小怎麼了 我小就不能滿足於你了嗎?」

2. Java實現學生簡易信息管理系統

importjava.util.*;
importjava.io.*;

classStuMgr{

publicstaticclassStudent{

;
publicStringname;
publicintage;

publicStudent(intid,Stringname,intage){
this.id=id;
this.name=name;
this.age=age;
}

@Override
publicStringtoString(){
returnid+","+name+","+age;
}
}

publicList<Student>stuList=newLinkedList<>();

publicvoidadd(){
Scannersc=newScanner(System.in);
System.out.println("請輸入學生學號:");
Stringid=sc.nextLine();
intintId=0;
try{
intId=Integer.parseInt(id);
}catch(NumberFormatExceptionex){
System.out.println("學號輸入有誤,請輸入數字!");
return;
}
if(find(intId)!=null){
System.out.println("該學號已經存在!");
return;
}
System.out.println("請輸入學生姓名:");
Stringname=sc.nextLine();
System.out.println("請輸入學生年齡:");
Stringage=sc.nextLine();
intintAge=0;
try{
intAge=Integer.parseInt(age);
}catch(NumberFormatExceptionex){
System.out.println("年齡輸入有誤,請輸入數字!");
return;
}
Studentstu=newStudent(intId,name,intAge);
stuList.add(stu);
store();
System.out.println("-----------------------");
System.out.println("學生信息已增加");
System.out.println(stu);
System.out.println("-----------------------");
}

publicvoiddel(){
Scannersc=newScanner(System.in);
System.out.println("請輸入學生學號:");
Stringid=sc.nextLine();
intintId=0;
try{
intId=Integer.parseInt(id);
}catch(NumberFormatExceptionex){
System.out.println("學號輸入有誤,請輸入數字!");
return;
}
Studentstu=find(intId);
if(stu==null){
System.out.println("該學號不存在!");
return;
}
stuList.remove(stu);
store();
System.out.println("-----------------------");
System.out.println("學生信息已刪除");
System.out.println(stu);
System.out.println("-----------------------");
}

publicvoidfind(){
Scannersc=newScanner(System.in);
System.out.println("請輸入學生學號:");
Stringid=sc.nextLine();
intintId=0;
try{
intId=Integer.parseInt(id);
}catch(NumberFormatExceptionex){
System.out.println("學號輸入有誤,請輸入數字!");
return;
}
Studentstu=find(intId);
if(stu==null){
System.out.println("該學號不存在!");
return;
}
System.out.println("-----------------------");
System.out.println("查找學生信息如下");
System.out.println(stu);
System.out.println("-----------------------");
}

publicStudentfind(intid){
for(Studentstu:stuList){
if(stu.id==id){
returnstu;
}
}
returnnull;
}

publicvoidmodify(){
store();
}

publicvoidforeach(){
System.out.println("-----------------------");
for(Studentstu:stuList){
System.out.println(stu);
}
System.out.println("-----------------------");
}

publicvoidstore(){
Iteratoriterator=stuList.iterator();
Filefile=newFile("stuList.txt");
FileWriterfw=null;
BufferedWriterwriter=null;
try{
fw=newFileWriter(file);
writer=newBufferedWriter(fw);
while(iterator.hasNext()){
writer.write(iterator.next().toString());
writer.newLine();//換行
}
writer.flush();
}catch(FileNotFoundExceptione){
e.printStackTrace();
}catch(IOExceptione){
e.printStackTrace();
}finally{
try{
writer.close();
fw.close();
}catch(IOExceptione){
e.printStackTrace();
}
}
}

publicstaticvoidmain(String[]args){
StuMgrmgr=newStuMgr();
while(true){
System.out.println("請選擇您要進行的操作:");
System.out.println("1:增加學生信息");
System.out.println("2:刪除學生信息");
System.out.println("3:查找學生信息");
System.out.println("4:修改學生信息");
System.out.println("5:遍歷學生信息");
System.out.println("6:退出");
System.out.println("-----------------------");
Scannersc=newScanner(System.in);
Stringop=sc.nextLine();
if("6".equals(op)){
return;
}
if("1".equals(op)){
mgr.add();
}
if("2".equals(op)){
mgr.del();
}
if("3".equals(op)){
mgr.find();
}
if("4".equals(op)){
mgr.modify();
}
if("5".equals(op)){
mgr.foreach();
}
}

}
}

時間倉促,還有一個modify方法沒實現,留給你自己練手。

3. 如何利用自學JavaWeb實現簡單的進存銷管理系統開發

我做了多年的Javaweb項目開發,目前在公司也還有一部分javaweb的開發工作。我以過來人的身份回答一下你的問題。

目前Javaweb的技術棧是比較成熟的,如果是你一個人開發的慧清話,主要學習以下三個方面基礎知識。

前端基礎知識和框架

如果做進銷存系統,前端web頁面的展示是需要前端知識。像javascript、css、html這些前端基礎知識還是要了解的。了解完後可以選擇一些前端的開發框架進行學習。如果你是前後端不分離方式的開發,可以了解thymeleaf等模板語言開發;如果是前後端分離方式的開發,可以了解vue、react、angular等框慧碧脊架以及antdesign等前端ui組建框架。我建議選擇vue,因為vue網上資料多,入門也更簡單一些。

後端springboot開發

目前滲前javaweb技術棧都是採用Springboot開發。Springboot的核心就是要了解Spring。SpringMVC、IOC等基礎知識一定要掌握。學習時可以結合網路上一些教學視頻(慕課網、騰訊課堂等網站上的教學資源)和一些javaweb的專業書籍來學習。

資料庫基礎

由於進銷存系統屬於管理類系統,可以採用簡單的mysql資料庫。學習mysql主要包括以下幾個方面。第一、資料庫基礎知識:表設計、事務、記錄操作等。第二、sql基礎語言:sql增刪改查語法,聚集函數,sql統計等相關知識。第三、mysql資料庫:資料庫安裝、使用等。

總結

閱讀全文

與java進存管理系統相關的資料

熱點內容
暴風轉碼如何添加文件夾 瀏覽:515
延安整合網路營銷有哪些 瀏覽:74
查找word打開過的文件在哪裡 瀏覽:137
b樹java代碼 瀏覽:683
電腦文件存儲 瀏覽:657
蘭州中考徵集志願在哪個網站 瀏覽:215
cs文件上傳下載 瀏覽:244
拷貝文件到根目錄下重命名linux 瀏覽:603
api函數的頭文件 瀏覽:249
華為怎麼綁定迷你編程 瀏覽:215
機構怎麼申請少兒編程考級 瀏覽:495
崑山數控編程哪裡好學 瀏覽:459
jspcfor跳出 瀏覽:65
word怎麼插入羅馬數字i 瀏覽:315
哪個網站可以找到法人代表 瀏覽:106
蘋果5s日版a1453支持什麼網路 瀏覽:297
微信打開文件如何設置 瀏覽:218
漫畫書app中非可視組件是什麼 瀏覽:3
d盤文件隱藏怎麼恢復 瀏覽:287
5s怎麼設置聯通4g網路 瀏覽:15

友情鏈接