home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 77 / IOPROG_77.ISO / tips / Java / ConnectionPool / src / it / favaroni / db / connectionpool / ConnectionItem.java next >
Encoding:
Java Source  |  2003-12-19  |  1.5 KB  |  83 lines

  1. package it.favaroni.db.connectionpool;
  2.  
  3. /**
  4.  * Bean che mappa la singola connessione.
  5.  * Data di creazione: (26/06/2003 09.58.13)
  6.  * @author: Roberto Favaroni
  7.  */
  8.  
  9. import java.sql.*;
  10. import java.util.*;
  11.  
  12. public class ConnectionItem {
  13.     private int counter = 0;
  14.     private Connection connection = null;
  15.     private boolean inUse = false;
  16.     private java.util.Date date = null;
  17. /**
  18.  * Commento del constructor ConnectionItem.
  19.  */
  20. public ConnectionItem() {
  21.     super();
  22. }
  23. /**
  24.  * Inserire qui la descrizione del metodo.
  25.  * Data di creazione: (26/06/2003 10.01.48)
  26.  * @return java.sql.Connection
  27.  */
  28. public java.sql.Connection getConnection() {
  29.     return connection;
  30. }
  31. /**
  32.  * 
  33.  * @return int
  34.  */
  35. public int getCounter() {
  36.     return counter;
  37. }
  38. /**
  39.  * 
  40.  * @return java.util.Date
  41.  */
  42. public java.util.Date getDate() {
  43.     return date;
  44. }
  45. /**
  46.  * 
  47.  * @return boolean
  48.  */
  49. public boolean isInUse() {
  50.     return inUse;
  51. }
  52. /**
  53.  * Inserire qui la descrizione del metodo.
  54.  * Data di creazione: (26/06/2003 10.01.48)
  55.  * @param newConnection java.sql.Connection
  56.  */
  57. public void setConnection(java.sql.Connection newConnection) {
  58.     connection = newConnection;
  59. }
  60. /**
  61.  * 
  62.  * @param newCounter int
  63.  */
  64. public void setCounter(int newCounter) {
  65.     counter = newCounter;
  66. }
  67. /**
  68.  * 
  69.  * @param newDate java.util.Date
  70.  */
  71. public void setDate(java.util.Date newDate) {
  72.     date = newDate;
  73. }
  74. /**
  75.  * 
  76.  * @param newInUse boolean
  77.  */
  78. public void setInUse(boolean newInUse) {
  79.     inUse = newInUse;
  80.     setDate(new java.util.Date());
  81. }
  82. }
  83.