
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 ...

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

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

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

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.

hi friend,
check your database table, possibly you didn't inserted the value into the table
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.