0
JavaプロジェクトのPostgresテーブルにipaddressを挿入しようとしています。org.postgresql.util.PSQLException:エラー:タイプinetの無効な入力構文:
String ipIns = "INSERT INTO trusted_domains(id, from_ip, to_ip) VALUES (?, ?, ?);";
pstmt = conn.prepareStatement(ipIns);
pstmt.setInt(1, Integer.parseInt(id));
pstmt.setObject(2, InetAddress.getByName(fromIP));
pstmt.setObject(3, InetAddress.getByName(toIP));
pstmt.execute();
私はこの文pstmt.setObject(2、InetAddress.getByName(fromIP))の例外を取得します。
org.postgresql.util.PSQLException:ERROR:タイプINETのための無効な入力構文:
親切にあなたが今ではそれを発見した
おかげ --SD
私は、そのpstmt.setObject(2、fromIP、Types.OTHERSを)それを得ました。 ありがとうございました - SD – SDS