Skip to content

Commit

Permalink
Commit pgtde_jdbc 9.4 source
Browse files Browse the repository at this point in the history
  • Loading branch information
bocaph committed Dec 1, 2015
1 parent a0bafcd commit 2320011
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 303 deletions.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 1997-2011, PostgreSQL Global Development Group
Portions Copyright (c) 1997-2011, PostgreSQL Global Development Group
Portions Copyright (c) 2015, NEC Corporation
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
20 changes: 20 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Postgresql JDBC driver for Transparent Data Encryption for PostgreSQL
=====================================================================

This directory contains the source code of the PostgreSQL JDBC driver for
Transparent Data Encryption for PostgreSQL.

Transparent Data Encryption for PostgreSQL(TDEforPG) is Encryption tool
for PostgreSQL, which adds encrypted data types to PostgreSQL.
For detail of information please refer to the URLs below.

Enterprise Edition
http://jpn.nec.com/tdeforpg/

Free Edition
https://github.com/nec-postgres/tdeforpg/wiki/Manual(JA)

PostgreSQL JDBC driver for TDEforPG is standard PostgreSQL JDBC with addition
feature which support some Object relational mappers (ORM) to operate with
TDEforPG encrypted data.

296 changes: 0 additions & 296 deletions README.md

This file was deleted.

2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ osgi.version=9.4.0.build-1203

maven.group.id=org.postgresql
maven.artifact.id=postgresql
maven.artifact.version=9.4-1203
maven.artifact.version=9.4-1203-tdeforpg1.1.1.0
maven.artifact.description=PostgreSQL JDBC Driver

# Maven snapshots and staging repository id and url
Expand Down
31 changes: 29 additions & 2 deletions org/postgresql/core/Field.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*-------------------------------------------------------------------------
*
* Copyright (c) 2003-2014, PostgreSQL Global Development Group
* Portions Copyright (c) 2003-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 2015, NEC Corporation
*
*
*-------------------------------------------------------------------------
Expand All @@ -22,6 +23,7 @@ public class Field
private final int mod; // type modifier of this field
private final String columnLabel; // Column label
private String columnName; // Column name
private boolean tdeDatatype = false; // is TDE datatype or not

private int format = TEXT_FORMAT; // In the V3 protocol each field has a format
// 0 = text, 1 = binary
Expand Down Expand Up @@ -77,13 +79,38 @@ public Field(String columnLabel, String columnName, int oid, int length, int mod
{
this.columnLabel = columnLabel;
this.columnName = columnName;
this.oid = oid;
// Update TDE data type's Oid
// to equivalent plain data types.
if (oid == Oid.ENCRYPT_TEXT) {
this.tdeDatatype = true;
this.oid = Oid.TEXT;
} else if (oid == Oid.ENCRYPT_BYTEA) {
this.tdeDatatype = true;
this.oid = Oid.BYTEA;
} else if (oid == Oid.ENCRYPT_NUMERIC) {
this.tdeDatatype = true;
this.oid = Oid.NUMERIC;
} else if (oid == Oid.ENCRYPT_TIMESTAMP) {
this.tdeDatatype = true;
this.oid = Oid.TIMESTAMP;
} else {
this.oid = oid;
}
this.length = length;
this.mod = mod;
this.tableOid = tableOid;
this.positionInTable = positionInTable;
}

/*
* @return whether Field's data type is TDE datatype or not
*/
public boolean isTDEDataType()
{
return tdeDatatype;
}


/*
* @return the oid of this Field's data type
*/
Expand Down
Loading

0 comments on commit 2320011

Please sign in to comment.