code: public static void send(final PacketOutputStream pos, final String database) throws IOException {
      pos.startPacket(0);
      pos.write(Packet.COM_INIT_DB);
      pos.write(database.getBytes("UTF-8"));
      pos.flush();
    }
docs: Send a COM_INIT_DB request to specify the default schema for the connection.
  
  @param pos         Write outputStream
  @param database    database name
  @throws IOException if connection problem occur