Hot answers tagged java
http://postgis.net/docs/manual-1.5/ch04.html#OpenGISWKBWKT says that you can convert it like that in both ways: bytea WKB = ST_AsBinary(geometry); text WKT = ST_AsText(geometry); geometry = ST_GeomFromWKB(bytea WKB, SRID); geometry = ST_GeometryFromText(text WKT, SRID);
You may use GeoTools, which is an open source java toolkit, for doing your union/dissolve process, check out this Q/A: combine several polygon objects in one polygon object with geotools (is it possible)?
If you need to do this a lot (more than a couple of times) then you could write a custom datastore by following the steps in this GeoTools tutorial. Then all you need to do is drop the jar file into your WEB-INF/lib folder and it will work just like any other datastore in GeoServer.
Only top voted, non community-wiki answers of a minimum length are eligible