Generate Employee ID (SCS-0001,SCS-0002......)

Generate Employee ID (SCS-0001,SCS-0002......)

Hello everyone i am beginner in java and i am working on my major project

I want to generate bill number and employee number like SCS-0001 and so on and bill number like SCS/'date''month'/001............ ie "SCS/0802/001"........ and so on in jsp or servlet and database is mysql... .. Please help ...

View Answers

February 9, 2013 at 3:09 PM

hi friend,

You can create a table as follows :

CREATE TABLE `employee` ( 
`tag_id` char(3) NOT NULL, 
`serial_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT, 
`dd` int(2) unsigned zerofill DEFAULT NULL, 
`mm` int(2) unsigned zerofill DEFAULT NULL, 
PRIMARY KEY (`tag_id`,`serial_id`), 
UNIQUE KEY `serial_id` (`serial_id`) 
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1

And insert some records into the columns as follows :

insert into employee(tagid,serialid,dd,mm) values ( 'SCS','001','08','02')

insert into employee(tagid,serialid,dd,mm) values ( 'SCS','002','09','02')

And to display in specific format you can use the concat() method as follows :

SELECT CONCAT(tagid,'-',serialid) as employeenumber FROM employee;

SELECT CONCAT(tagid,'/',dd,mm,'/',serialid) as billnumber FROM employee;

For detail tutorial please go through the following link

MySQL Generate AlphaNumberic Id In JSP


February 9, 2013 at 8:25 PM

Not working actually null pointer exception .........


February 9, 2013 at 8:26 PM

is it auto generate the id ?? or we should insert the value int it ??


February 11, 2013 at 6:08 PM

hi friend,

It would be required to insert the value in the database table except the auto increment field. As shown in the tutorial or if your problem still persist you can send your full code we will try to solve it

Thanks.


February 11, 2013 at 6:10 PM

hi friend,

check your database table, possibly you didn't inserted the value into the table









Related Tutorials/Questions & Answers:
Generate Employee ID (SCS-0001,SCS-0002......)
Generate Employee ID (SCS-0001,SCS-0002......)  Hello everyone i am beginner in java and i am working on my major project I want to generate bill number and employee number like SCS-0001 and so on and bill number like SCS/'date
generate ID
generate ID   Statement st1=con.createStatement(); String sql="insert into employee values(emp_seq.nextval,'"+ename+"','"+eadd+"','"+ephone+"','"+email+"','"+department+"',"+Integer.parseInt(ebpay)+",20,0)"; st1.executeUpdate
Advertisements
Auto Generated Employee ID
Auto Generated Employee ID  Hello Everyone I want to generate an ID like (SCS-0001) and then it should be auto incremented each time a new employee add page is opens. I am using My Sql database
need to generate ID
need to generate ID  hai, i need to generate ID i.e when i select addemploye option and submit, it should generate a emp ID which is 1 greater than the previous highest ID value stored in database. eg: if the higest value
need to generate ID
need to generate ID  hai, i need to generate ID i.e when i select addemploye option and submit, it should generate a emp ID which is 1 greater than the previous highest ID value stored in database. eg: if the higest value
how to auto generate number in jsp with the database connection mysql for employee number?
how to auto generate number in jsp with the database connection mysql for employee number?  how to auto generate number in jsp with the database connection mysql for employee number?   <%@page import="java.sql.
how to auto generate number in jsp with the database connection mysql for employee number?
how to auto generate number in jsp with the database connection mysql for employee number?  how to auto generate number in jsp with the database connection mysql for employee number?   <%@page import="java.sql.
store the employee ID,name,login time and logout time of the employee in database
store the employee ID,name,login time and logout time of the employee in database  hello...I want to store the employee ID,name,login time and logout time of the employee along with the time difference between these two
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'  ...: No module named 'odoo10-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'  ...: No module named 'odoo10-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'  ...: No module named 'odoo11-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'  ...: No module named 'odoo12-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'  ...: No module named 'odoo12-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'  ...: No module named 'odoo12-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-id'  Hi...: No module named 'odoo8-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'  ...: No module named 'odoo11-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id' error? Thanks
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id'  ...: No module named 'odoo12-addon-hr-employee-id' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-id' error? Thanks
get details of employee after enter the emp_id
get details of employee after enter the emp_id  how to get employee details after entered the emp_id from database after that we have three more option add new,modify and delet employee   Please visit the following
get details of employee after enter the emp_id
get details of employee after enter the emp_id  how to get employee details after entered the emp_id from database after that we have three more option add new,modify and delet employee   Please visit the following
i need the source code to generate id in jsp
i need the source code to generate id in jsp  hai,i need the source code for generate id...which is i need to generate the new id from the maximum... of generate ids each should have some range...plz give the source code in jsp with ms
the best way to generate a universally unique object ID.
the best way to generate a universally unique object ID.  What is the best way to generate a universally unique object ID? Do I need to use an external resource like a file or database, or can I do it all in memory
Using Hibernate <generator> to generate id incrementally - Struts
Using Hibernate to generate id incrementally  Hi All, How to increment id using Hibernate ( or if any other) to generate id. I am using... to specify the class name to be used to generate the primary key for new record while
MySQL Generate AlphaNumberic Id In JSP
MySQL Generate AlphaNumberic Id In JSP In this section we will discus about how to generate id in specific format in MySQL and JSP. This example explains you that how to generate alpha numeric id in MySQL and also how to fetch
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-legacy-id'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-legacy-id' ...: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-legacy-id' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-legacy-id
ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-legacy-id'
ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-legacy-id' ...: ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-legacy-id' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-hr-employee-legacy-id'
Employee form
Employee form  In employee form emp Id id after any data iserted is incremented for oher data insertion. insert, delete, update buttons when we cleak the select buttoun then the created table data iserted automaticaly
Adding an employee
Adding an employee  coding for adding an employee
Add Employee
Add Employee  coding for adding an employee
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
EMPLOYEE - SQL
EMPLOYEE  CALCULATE EMPLOYEE SALARY  Hi friend, Please give the full details of Problem. Thanks
generate file
generate file  How to generate file(.doc or .xls or .txt ) with containing data in it.By clicking on a link
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
application for an Employee
: in this page it should modify employee data and persist in DB 3.DISPLAY
employee progarm
employee progarm  Hai, I have developed a code for an employee program by using jtext fields and buttons,it has no errors but while we are compiling it it is saying that "Exception in thread "main
how to generate auto code ?
how to generate auto code ?  i wanna genrate auto code for id in core java. pls tell me code of auto genrate
generate report
generate report  hai, im learning php so pls help me .... what is a coding for generate report by month using php... wat is a code php for create calender and listing from database... pls someone help me
generate report
generate report  hai, im learning php so pls help me .... what is a coding for generate report by month using php... wat is a code php for create calender and listing from database... pls someone help me
Generate xml
Generate xml  hi can i generate xml file with xsd using JAXP in java. if possible please send java code. Thanks.   Please visit the following link: http://www.roseindia.net/xml/creating-xml-tree.shtml
Generate Keys
Generate Keys  hello i need code to generate key , after that send Keys to email address user. for example if you member in your website,if member not having Secret Keys not can download files if member having secret key i
id
id  how to find date of birth and gender in id in html with the help of javascript
coding for employee management system
coding for employee management system  coding for employee management system
Employee Management System
Employee Management System  coding for employee management system
Employee Management System
Employee Management System  coding for employee management system

Ads