RE: replication management via jdbc
"Parker, David" <[email protected]> Fri, 21 May 2010 08:54:44 -0500
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <B13731FE885FBF498CDEF2D46175813C97DC73C858@AUSP01VMBX24.collaborationhost.net> |
--_000_B13731FE885FBF498CDEF2D46175813C97DC73C858AUSP01VMBX24c_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ah, I see. I didn't realize that the output was fielded - I thought it woul= d just be a string I would have to parse. Yeah, that's easy. Thanks! - DAP From: Ronald Klop [mailto:[email protected]] Sent: Friday, May 21, 2010 5:34 AM To: Parker, David Cc: [email protected] Subject: Re: replication management via jdbc It isn't that hard. Statement stat =3D conn.createStatement(); try { ResultSet rs =3D stat.executeQuery("SHOW MASTER STATUS"); if (!rs.next()) { throw new RuntimeException("Unexpected empty resultset."); } String file =3D rs.getString("File"); long position =3D rs.getLong("Position")); } finally { conn.close(); } Op donderdag, 20 mei 2010 20:26 schreef "Parker, David" <david.parker@quant= iaco.com>: I'd be interested to hear if anybody has used Java to maintain their replic= ation state. I'm mainly wondering if there are any jdbc extensions for thin= gs like SHOW MASTER, etc. Thanks! -- DAP ---------------------------------------------------------------------------= ----------------------------------------------- ________________________________ --_000_B13731FE885FBF498CDEF2D46175813C97DC73C858AUSP01VMBX24c_--