導航:首頁 > 編程語言 > 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進存管理系統相關的資料

熱點內容
文件控制電腦 瀏覽:220
pdf文件頁數怎麼讀 瀏覽:489
iphone的文稿與數據在哪個文件夾 瀏覽:918
把文件夾設置密碼 瀏覽:895
網路電視遙控器怎麼對接 瀏覽:169
海爾網站屬於什麼類型網站 瀏覽:565
數據結構要看哪個版本的 瀏覽:557
三菱編程如何寫轉換模式 瀏覽:375
網路刻錄機怎麼連接電腦顯示屏 瀏覽:540
網路男主播怎麼做 瀏覽:104
官媒雜志或者報紙有哪些app 瀏覽:343
如何繼續安裝刪去的app 瀏覽:456
手機泰坦之旅安裝文件夾找不到 瀏覽:36
qq發送文件可以撤回嗎 瀏覽:919
vb連接網路 瀏覽:911
iframesrc禁止查看源文件 瀏覽:854
兒童編程的機構有哪些內容 瀏覽:613
視頻文件格式怎麼變 瀏覽:988
asp首頁文件 瀏覽:330
直接吹還是走程序 瀏覽:725

友情鏈接