public void initTicket(String id) {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
String sqlStr = "INSERT INTO SHAREDTICKETS (ID, NAME,CONTENT) VALUES (?, ?, ?)";
TicketInfo ticket = new TicketInfo();
try {
//get connection
con = getConnection();
//prepare statement
ps = con.prepareStatement(sqlStr);
ps.setString(1, id);
ps.setString(2, ticket.getName());
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bytes);
out.writeObject(ticket);
ps.setBytes(3, bytes.toByteArray());
//execute