Home Answers Viewqa Java-Beginners how to make employee i card

 
 


rohankhanna
how to make employee i card
1 Answer(s)      8 months ago
Posted in : Java Beginners

hello friends

can anyone help me..

I have to make a project to make Identity card for employees...but i am facing problems with database and jsp connection ...

also tell me how to retrive data such as name and image at a paticular place on the I-card...plz reply as soon as possible....

Thank you in advance

Rohan

View Answers

September 17, 2012 at 11:42 AM


Here is a jsp code that retrieves the name and image from the database and display it in the html table.

1)data.jsp:

<%@ page import="java.sql.*,java.io.*,java.util.*" %> 
<HTML>
 <table border="1">
 <tr><th>Name</th><th>Address</th><th>Image</th></tr>
   <%
  try{      
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
    Statement stmt=con.createStatement();
    String strQuery = "select * from data";
    ResultSet rs = stmt.executeQuery(strQuery);
    while(rs.next()){
       %>
      <tr>
      <td><%=rs.getString("name")%></td><td><%=rs.getString("address")%></td>
      <td align="center">

<img src="image.jsp?imgid=<%=rs.getInt(1)%>" width="50" height="50">
</a></td>
      </tr>
      <%
    }
    rs.close();
    con.close();
    stmt.close();
  }
  catch(Exception e)
  {
    e.getMessage();
  }
  %>
 </table>
</HTML>

2)image.jsp:

<%@ page import="java.sql.*,java.io.*,java.util.*" %> 
<%
  int id =  Integer.parseInt(request.getParameter("imgid"));
  try{      
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");      
    Statement st=con.createStatement();
    String strQuery = "select image from data where id="+id;
    ResultSet rs = st.executeQuery(strQuery);

    String imgLen="";
    if(rs.next()){
      imgLen = rs.getString(1);
       }  
    rs = st.executeQuery(strQuery);
    if(rs.next()){
      int len = imgLen.length();
      byte [] rb = new byte[len];
      InputStream readImg = rs.getBinaryStream(1);
      int index=readImg.read(rb, 0, len);  
      st.close();
      response.reset();
      response.getOutputStream().write(rb,0,len); 
      response.getOutputStream().flush();        
    }
  }
  catch (Exception e){
    e.printStackTrace();
  }
%>









Related Pages:
how to make employee i card
how to make employee i card  hello friends can anyone help me.. I have to make a project to make Identity card for employees...but i am facing... such as name and image at a paticular place on the I-card...plz reply as soon
How to make a valentine card
How to make a valentine card Learn a easy technique to make a valentine card. It is very interesting design, I hope you will like it. Follow now step by step instruction to make it. New File: Take a new file
Problem in show card in applet.
but Not show card in the applet, then I add a code in paintComponent method like... have tried to solve this error but finally I am not solving, Please help me how can I show all the card in the applet. Work I have done:- 1) Create Dynamic web
Credit Card Validation - Java Beginners
Credit Card Validation  i have to do a project for my comp sci class. yet i dont know how to select the last digit of a credit card number strings... up the digits in the credit card number, working from right to left
display the employee name
display the employee name  when i will select one employee designation based on that employee designation display the particular designation employee name display in another select box how it possible using servlet and mysql
how to make multiple rectangles
how to make multiple rectangles  I,m a beginner , m sorry if the question is really simple i have an array list.I want to print the contents..."); classlist.add("card"); classlist.add("yes"); for(int i=0;i<=classlist.size();i
how can i make monthly register ?
how can i make monthly register ?  how can i make monthly register ? iam using jdeveloper
how I make the numbers in descending order ?
how I make the numbers in descending order ?   public class Quiz1...]+" "); } } thanks how I make the numbers in descending order ?   ...(System.in); int number [] = new int [20]; int num =2; for(int i =0; i<
Problem in card demo example.
Problem in card demo example.  Hi, I have successfully shows... help me, I am using Eclipse and card demo example by following link http... for this, now It's OK, but i have done drag-drop of card and move in the applet
Card Demo
Java: Example - Card Demo This program reads in a bunch of images (cards... is never changed even if a card is dragged, which give the peculiar effect of dragging under. It is divided into several source files. The card images
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
credit card validation
is between 13 and 16, then the card number is valid; otherwise, it is invalid. i...credit card validation   Double every second digit from right to left... digits in the odd places from right to left in the card number. 6 + 6 + 0 + 8 + 0
employee progarm
employee progarm  Hai, I have developed a code for an employee..." java.lang.NoClassDefFoundError: Emp/java".Why it is saying like this?The code which i developed.../addeditanddeleteemployee_inf.shtml   i don't want the program actually i want yuo
jsp code for employee payroll - JSP-Servlet
jsp code for employee payroll  jsp code for employee payroll. i need to generate the payslip with tax calucation and deductions,allwoance .how to calculate the employee tax using the jsp code  Hi Friend, Try
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILES,IF I ENTER 4 EMPLOYEE DETAILS(NAME,ID,SALARY,EMAIL) ALL THE DETAILS OF 4
How to make selectOneMenu scrollable
How to make selectOneMenu scrollable  how to make the selectOneMenu scrollable? I have around 20 values in drop down and i want the scrollable functionality after 5 values. Kindly reply as soon as possible. Thanks Shikha
how can i make a session invalidate in java when browser is closed
how can i make a session invalidate in java when browser is closed   how can i make a session invalidate in java when browser is closed   ... that shows the user account page fetching from session(same browser). So I wanted
How to send request to the visa/master card to get verifed the credit card - Security
How to send request to the visa/master card to get verifed the credit card  Sending request to verify the card number
How to send request to the visa/master card to get verifed the credit card - Security
How to send request to the visa/master card to get verifed the credit card  we are accepting the credit card number, So how to forward request get verified the card number. Thanks You
How to make a sharpen image
How to make a sharpen image I am going to make a sharp picture effect, I have here a dog picture to modify. Open Picture: Capture a picture to make sharp effect. Effects: Go to Image Menu
Add Edit And Delete Employee Information
employee will be displayed on the respective textfields and the user can easily make... Add Edit and Delete Employee Information Using Swing       In this section, you will learn how to add
how i want to create a coding by this question?
how i want to create a coding by this question?  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee. A person has a name, address, phone number
How to make bubbles, make bubbles, bubbles
How to make bubbles      ... make another bubbles as I have done here. This is final result. Look here... to make it easily to draw. New File: First take colored background file. Draw
How to make a transparent text
How to make a transparent text Learn how to make a transparent...) and make formatting as looking here. Write Text: Now write your text as you like. I have written here "Text". After writing text make copy (Ctr
How to send request to the visa/master card to get verifed the credit card - Security
How to verifed the credit card  Can anyone please explain me ...how to verify the card number while accepting payment online
Make A website
Make A website  How expensive(hire someone) or hard would it be to create a website like this? I want to build a website where people can be users of the website with a small profile. Their is a point system (kinda like money
how to make multiple choice questions
how to make multiple choice questions  I have to make a multiple choice choice using JSP/Servlets. I created a a session bean for the questions and answers. how to associate group of questions to a user? so each user will have
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
How to make query and abstraction in Java
How to make query and abstraction in Java  Hi, I read the lessons you have in the sites. They are really useful. However, I could not write codes... PostgreSQL database, and I want to make a query and abstraction for a table. Could
How to Make iPhone Window Application
How to Make iPhone Window Application  Hi, For Making iphone window application, what parameters i have to follow or provide example related to iphone window application. Thanks
How to make a text effect.
How to make a text effect.       This is a text effect tutorial, you can make your text into a deferent condition by my this example.  There is so many type to make
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
Make Money
Make Money       Can I make money from my web site by writing articles? Yes, You can make money from your web site. We are providing free information
How to make a button of different behaviour?
How to make a button of different behaviour?  Suppose In a jsp page I...").value,......); Now I want the SAVE button to be changed to UPDATE button id... ajaxInsertUpdateData(document.getElementByID("btnSave1").value,......); How to do
How To Make This Program - Java Beginners
How To Make This Program  How To Make Java Calculation program I... number, prints it, then calculates the sum... output: 59 14 5 please help to make...{public static void main(String args[])throws IOException{int i,a=0,b,n=0,count=0
Select Employee and display data from access database in a jtable
Select Employee and display data from access database in a jtable  I there Iam a java beginner. I have to create a application where I can select a employee's name from a comboBox and the jtable will be filled with all
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
how to make combinations - Development process
how to make combinations  import java.util.*; interface Expression... or condition5) ") p.evaluate(); } } i need the ouput as follows can any one help... if the i/p is like this action when condition1 or (condition2
how to make paging with class and ajax
how to make paging with class and ajax  paging with class and ajax...,$table,$totalres,$totalpages; var $r,$i;</p>...;"; for ($i=0; $i < mysql_num_fields($this->sql); $i++) //Table Header
Employee Details - JSP-Servlet
Employee Details  Respected Sir/Madam, Thanks for your response. Regarding that alert box problem what I have decided is to include.... Will it work for me. Will it be executing according to my requirement. If yes,I will try
Print Card Website Templates
to modify and make changes print card website templates according to the needs...In rose India we create various kinds of printing card templates like. Greeting cards, Invitation cards, Marriage Card etc. Our customized print cards
HTML make a thumbnail
HTML make a thumbnail  How do I make a thumbnail for my image
how do i make a phone call from my app without quitting my application
how do i make a phone call from my app without quitting my application  hi, I am working on creating a call application, i am making a call from my... quits , i want my application to go to background and resume on call end ...please
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
How can I do it? .click();
want that it make mouseup in this element. How can I do it, because if I write...How can I do it? .click();  I have a very unusual problem. I want to make a script like this: <script> x = document.getElementById
make trial application
make trial application  Hello java master, i want to ask something about make java application trial in one month or two month. how to combine my application and give a trial application. what i must to do? Can you give me
how to make list in our own style in pdfwriter
how to make list in our own style in pdfwriter  can u please any of one help me i want to make a list as follows in pdf file from java by pdfwriter account calculation ------------------------- amount -100.00
How to make a cross eye, make a cross eye, cross eye
How to make a cross eye       You can make a cross eye effect with any type of eye picture by using... any eye picture as I have here. Selection: Make selection of the eyeball

Ask Questions?

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.