话单分析之ConnectionInstance

object ConnectionInstance {

private var conn: Connection =null

  def getConnection(conf: Configuration): Connection = {

if (conn ==null ||conn.isClosed) {

conn = ConnectionFactory.createConnection(conf);

}

conn

  }

}

你可能感兴趣的:(话单分析之ConnectionInstance)