Skip to content

Commit ec09f71

Browse files
committed
update project and run instuctions 🎨
1 parent 42ef90a commit ec09f71

35 files changed

+169
-14
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="src"/>
4-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5-
<classpathentry kind="lib" path="C:/Users/Bitto/Downloads/Compressed/jdbc code and mysql driver/mysql-connector-java-5.1.34-bin.jar"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
5+
<attributes>
6+
<attribute name="module" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="lib" path="lib/mysql-connector-j-8.0.33.jar"/>
610
<classpathentry kind="output" path="bin"/>
711
</classpath>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/student-photos/
File renamed without changes.

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
Student Management System Desktop Application JAVA using NeatBeans
2-
====================
3-
4-
Student Management System Desktop Application Created with JAVA using NeatBeans
1+
# Student Management System Desktop Application JAVA using Eclipse IDE
52

63
Student management system is an environment where all the process of the student in the institution is managed. It is done through the automated.
74

@@ -10,3 +7,48 @@ Store the First name of the student.
107
Store the Last name of the student.
118
Store the unique Roll number for every student.
129
Store the CGPA of every student so on....
10+
11+
## Screenshots
12+
13+
![](screenshots/sample2.png)
14+
![](screenshots/sample1.png)
15+
16+
## Requirements
17+
18+
- Eclipse IDE
19+
- Mysql 8 database
20+
21+
# How to run the application
22+
23+
### Database Config
24+
25+
Mysql 8 database is required for the application.
26+
**_If you have mysql database already installed follow the below instruction:_**
27+
28+
- Create a database named **smsdb**
29+
- import **smsdb.sql** into the **smsdb** database
30+
- Configure **db.java** class with your database connection parameters
31+
32+
Database configuration Instructions images:
33+
34+
![](screenshots/db.png)
35+
36+
**If you do not have mysql database you can install it on your computer by yourself** or you can use the below instruction to install it with docker:
37+
38+
- Install **docker** and **docker-compose** for your OS
39+
- goto project root directory and run using **command prompt** or terminal: **docker-compose up -d**
40+
- You are all done.
41+
42+
If you used docker to install database then you can go to http://localhost:8181 from browser to see all databases.
43+
44+
## Running the application
45+
46+
Select the project and _Run as_ **Java Application**
47+
48+
![](screenshots/run.png)
49+
50+
### If error occurred during running the application
51+
52+
Please add this **/lib/mysql-connector-j-8.0.33.jar into** file into **Build Path** if the application is not running. Add it like below:
53+
54+
![](screenshots/build-path.png)

StudentManagement/bin/DOB.class

-1.17 KB
Binary file not shown.
-1.31 KB
Binary file not shown.
-1.02 KB
Binary file not shown.
-796 Bytes
Binary file not shown.
-3.84 KB
Binary file not shown.
-1.01 KB
Binary file not shown.
-9.62 KB
Binary file not shown.
-712 Bytes
Binary file not shown.
-696 Bytes
Binary file not shown.
-742 Bytes
Binary file not shown.
-2.46 KB
Binary file not shown.
-7.17 KB
Binary file not shown.

StudentManagement/bin/db.class

-4.35 KB
Binary file not shown.

bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/student/

docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Use root/example as user/password credentials
2+
version: '3.1'
3+
4+
services:
5+
6+
db:
7+
image: mysql
8+
command: --default-authentication-plugin=mysql_native_password
9+
restart: always
10+
environment:
11+
MYSQL_ROOT_PASSWORD: password
12+
volumes:
13+
- ./mysql-dump:/docker-entrypoint-initdb.d
14+
network_mode: "bridge"
15+
ports:
16+
- 3306:3306
17+
18+
adminer:
19+
image: adminer
20+
restart: always
21+
network_mode: "bridge"
22+
ports:
23+
- 8181:8080

lib/mysql-connector-j-8.0.33.jar

2.37 MB
Binary file not shown.

mysql-dump/01.sql

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 3.3.9
3+
-- http://www.phpmyadmin.net
4+
--
5+
-- Host: localhost
6+
-- Generation Time: Jan 24, 2017 at 03:54 PM
7+
-- Server version: 5.5.8
8+
-- PHP Version: 5.3.5
9+
10+
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11+
12+
CREATE DATABASE smsdb;
13+
14+
USE smsdb;
15+
16+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
17+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
18+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
19+
/*!40101 SET NAMES utf8 */;
20+
21+
--
22+
-- Database: `smsdb`
23+
--
24+
25+
-- --------------------------------------------------------
26+
27+
--
28+
-- Table structure for table `student_info`
29+
--
30+
31+
CREATE TABLE IF NOT EXISTS `student_info` (
32+
`id` int(255) NOT NULL AUTO_INCREMENT,
33+
`name` text NOT NULL,
34+
`dob` text NOT NULL,
35+
`fname` text NOT NULL,
36+
`mname` text NOT NULL,
37+
`sex` text NOT NULL,
38+
`nationality` text NOT NULL,
39+
`religion` text NOT NULL,
40+
`blood` text NOT NULL,
41+
`subject` text NOT NULL,
42+
`admission` text NOT NULL,
43+
`address` text NOT NULL,
44+
`studentid` text NOT NULL,
45+
PRIMARY KEY (`id`)
46+
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
47+
48+
--
49+
-- Dumping data for table `student_info`
50+
--
51+
52+
53+
-- --------------------------------------------------------
54+
55+
--
56+
-- Table structure for table `user`
57+
--
58+
59+
CREATE TABLE IF NOT EXISTS `user` (
60+
`id` int(255) NOT NULL AUTO_INCREMENT,
61+
`un` text NOT NULL,
62+
PRIMARY KEY (`id`)
63+
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
64+
65+
--
66+
-- Dumping data for table `user`
67+
--
68+
69+
INSERT INTO `user` (`id`, `un`) VALUES
70+
(1, 'kazi'),
71+
(3, 'bitto');
File renamed without changes.

screenshots/build-path.png

87.3 KB
Loading

screenshots/db.png

31.4 KB
Loading

screenshots/run.png

34.4 KB
Loading

screenshots/sample1.png

46 KB
Loading

screenshots/sample2.png

37.8 KB
Loading

StudentManagement/src/DOB.java renamed to src/student/management/system/DOB.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package student.management.system;
12
import java.text.DateFormat;
23
import java.text.SimpleDateFormat;
34
import java.text.ParseException;

StudentManagement/src/IDGENARATOR.java renamed to src/student/management/system/IDGENARATOR.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package student.management.system;
12
import java.util.*;
23

34
public class IDGENARATOR {

StudentManagement/src/StudentManagement.java renamed to src/student/management/system/StudentManagement.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package student.management.system;
12
import java.awt.BorderLayout;
23
import java.awt.EventQueue;
34

@@ -22,6 +23,7 @@
2223
import java.io.File;
2324
import java.io.IOException;
2425
import java.nio.file.Files;
26+
import java.nio.file.Paths;
2527

2628
import javax.swing.AbstractListModel;
2729
import javax.swing.JComboBox;
@@ -61,7 +63,7 @@ public void run() {
6163
//data.get_un();
6264
}
6365
else {
64-
66+
lblNewLabel.setText("Database Connection Error");
6567
}
6668
} catch (Exception e) {
6769
e.printStackTrace();
@@ -78,7 +80,8 @@ public StudentManagement() {
7880
setResizable(false);
7981
setTitle("Student Management System");
8082
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
81-
setBounds(100, 100, 498, 638);
83+
setBounds(100, 100, 560, 638);
84+
setResizable(true);
8285
contentPane = new JPanel();
8386
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
8487
setContentPane(contentPane);
@@ -184,10 +187,16 @@ public void actionPerformed(ActionEvent arg0) {
184187
if(choose_file==1) {
185188
String id=data.insert_data(name.getText(), comboBox_1.getSelectedItem().toString()+"/"+comboBox.getSelectedItem().toString()+"/"+comboBox_2.getSelectedItem().toString(), fname.getText(), mname.getText(), sex.getSelectedItem().toString(), nationality.getSelectedItem().toString(), religion.getSelectedItem().toString(), blood.getSelectedItem().toString(), subject.getSelectedItem().toString(), comboBox_9.getSelectedItem().toString()+"/"+comboBox_8.getSelectedItem().toString()+"/"+comboBox_10.getSelectedItem().toString(), address.getText(), idgen.genarate());
186189
if(id.compareTo("error")!=0) {
190+
try {
191+
Files.createDirectories(Paths.get("student-photos/"));
192+
} catch (IOException e) {
193+
// TODO Auto-generated catch block
194+
e.printStackTrace();
195+
}
187196
file = fc.getSelectedFile();
188-
File dest = new File("photo/"+id+".jpg");
189-
197+
File dest = new File("student-photos/"+id+".jpg");
190198
try {
199+
Files.deleteIfExists(dest.toPath());
191200
Files.copy(file.toPath(), dest.toPath());
192201
} catch (IOException e) {
193202
// TODO Auto-generated catch block

StudentManagement/src/StudentSearch.java renamed to src/student/management/system/StudentSearch.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package student.management.system;
12
import java.awt.BorderLayout;
23
import java.awt.Dimension;
34
import java.awt.EventQueue;
@@ -81,7 +82,7 @@ public void actionPerformed(ActionEvent e) {
8182
});
8283
JLabel lblEnterStudentId = new JLabel("Enter Student ID:");
8384

84-
ImageIcon image = new ImageIcon("photo/aaa.jpg");
85+
ImageIcon image = new ImageIcon("photo/default.jpg");
8586
Image scaleImage = image.getImage().getScaledInstance(180, 180,Image.SCALE_DEFAULT);
8687

8788
ImageIcon icon1 = new ImageIcon(scaleImage);
@@ -137,7 +138,7 @@ public void actionPerformed(ActionEvent arg0) {
137138
lblSid.setText(sinfo[11]);
138139
lblAddress_1.setText(sinfo[10]);
139140

140-
ImageIcon icon = new ImageIcon("photo/"+sinfo[11]+".jpg");
141+
ImageIcon icon = new ImageIcon("student-photos/"+sinfo[11]+".jpg");
141142
Image scaleImage = icon.getImage().getScaledInstance(180, 180,Image.SCALE_DEFAULT);
142143

143144
ImageIcon icon1 = new ImageIcon(scaleImage);

StudentManagement/src/db.java renamed to src/student/management/system/db.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
package student.management.system;
12
import java.sql.*;
23
/**
34
*
4-
* @author Teacher
5+
* @author bittokazi
56
*/
67
public class db {
78

@@ -11,7 +12,7 @@ public class db {
1112

1213
// Database credentials
1314
static final String USER = "root";
14-
static final String PASS = "";
15+
static final String PASS = "password";
1516

1617
Connection conn = null;
1718
Statement stmt = null;

0 commit comments

Comments
 (0)