1 4 package it.bigatti.c6; 5 6 import java.sql.Connection ; 7 import java.sql.DriverManager ; 8 import java.sql.ResultSet ; 9 import java.sql.SQLException ; 10 import java.sql.Statement ; 11 12 17 public class BadgeDAO { 18 19 Connection conn = null; 20 private static BadgeDAO instance = null; 21 22 private BadgeDAO() throws SQLException , ClassNotFoundException { 23 } 27 28 public static BadgeDAO getInstance() 29 throws SQLException , ClassNotFoundException { 30 if( instance == null ) { 31 instance = new BadgeDAO(); 32 } 33 return instance; 34 } 35 36 boolean verificaBadge( String badge ) throws SQLException { 37 62 return true; 63 } 64 65 66 void registra( String badge ) throws SQLException { 67 83 } 84 85 86 public static String badgeCode(String badgeLine) { 87 final String prefix = "BADGE: "; 88 String badge = badgeLine.substring( 89 badgeLine.indexOf( prefix ) + prefix.length() ); 90 return badge; 91 } 92 } 93 | Popular Tags |