<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 9pt;
font-family:±¼¸²
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hi all.<br><br>I have a big problem on my work.<br><br>First of all, the version based on my work is PostgreSQL : 8.1.11, PostGIS : 1.5.2.<br><br>The problem is I can not get the value of Point and Polygon.<br><br>The code is below :<br><br>blah blah --------------------------------------------------------------------------------<br>public Test find(String Id) throws DAOException, ClassNotFoundException, SQLException {<br>        Class.forName("org.postgresql.Driver");<br>        String url = "jdbc:postgresql://localhost:8080/testdao";<br>        Connection conn = DriverManager.getConnection(url, admin, apple);<br>        PreparedStatement ps = conn.prepareStatement("select name, addr, ST_AsText(position) from listFriend where id=?");<br>        ps.setString(1, Id);<br><br>        ResultSet rs = ps.executeQuery();<br>        <br>//        ((org.postgresql.PGConnection)conn).addDataType("point",Class.forName("org.postgis.Point"));<br>        <br>        while(rs.next()) {<br>            test = new Test();<br>            p = new Point();<br>            <br>            test.setName(rs.getString(1));<br>            test.setAddr(rs.getString(2));<br>            test.setPosition(p);<br>//            System.out.println(rs.getString(3));<br>------------------------------------------------------------------------------------------<br><br>If I run the sentence, "System.out.println(rs.getString(3));, it works. It prints right output like "Point(13.123 11.123)".<br><br>But I don't know how to fix test.setPosition(p);<br><br>any helps will be thank.<br><br><br>P.S. is it possible to be reason why the low or high version of PostgreSQL and PostGIS?<br><br><br>Best Regards<br>Kevin Lee.<br>                                           </div></body>
</html>