id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
60,200
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/LruCache.java
LruCache.put
public synchronized void put(Key key, Value value) { long valueSize = value.getSize(); if (maxSizeBytes == 0 || maxSizeEntries == 0 || valueSize * 2 > maxSizeBytes) { // Just destroy the value if cache is disabled or if entry would consume more than a half of // the cache evictValue(value); ...
java
public synchronized void put(Key key, Value value) { long valueSize = value.getSize(); if (maxSizeBytes == 0 || maxSizeEntries == 0 || valueSize * 2 > maxSizeBytes) { // Just destroy the value if cache is disabled or if entry would consume more than a half of // the cache evictValue(value); ...
[ "public", "synchronized", "void", "put", "(", "Key", "key", ",", "Value", "value", ")", "{", "long", "valueSize", "=", "value", ".", "getSize", "(", ")", ";", "if", "(", "maxSizeBytes", "==", "0", "||", "maxSizeEntries", "==", "0", "||", "valueSize", "...
Returns given value to the cache. @param key key @param value value
[ "Returns", "given", "value", "to", "the", "cache", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/LruCache.java#L127-L145
60,201
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/LruCache.java
LruCache.putAll
public synchronized void putAll(Map<Key, Value> m) { for (Map.Entry<Key, Value> entry : m.entrySet()) { this.put(entry.getKey(), entry.getValue()); } }
java
public synchronized void putAll(Map<Key, Value> m) { for (Map.Entry<Key, Value> entry : m.entrySet()) { this.put(entry.getKey(), entry.getValue()); } }
[ "public", "synchronized", "void", "putAll", "(", "Map", "<", "Key", ",", "Value", ">", "m", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Key", ",", "Value", ">", "entry", ":", "m", ".", "entrySet", "(", ")", ")", "{", "this", ".", "put", "(...
Puts all the values from the given map into the cache. @param m The map containing entries to put into the cache
[ "Puts", "all", "the", "values", "from", "the", "given", "map", "into", "the", "cache", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/LruCache.java#L152-L156
60,202
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.lock
private void lock(Object obtainer) throws PSQLException { if (lockedFor == obtainer) { throw new PSQLException(GT.tr("Tried to obtain lock while already holding it"), PSQLState.OBJECT_NOT_IN_STATE); } waitOnLock(); lockedFor = obtainer; }
java
private void lock(Object obtainer) throws PSQLException { if (lockedFor == obtainer) { throw new PSQLException(GT.tr("Tried to obtain lock while already holding it"), PSQLState.OBJECT_NOT_IN_STATE); } waitOnLock(); lockedFor = obtainer; }
[ "private", "void", "lock", "(", "Object", "obtainer", ")", "throws", "PSQLException", "{", "if", "(", "lockedFor", "==", "obtainer", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Tried to obtain lock while already holding it\"", ")", "...
Obtain lock over this connection for given object, blocking to wait if necessary. @param obtainer object that gets the lock. Normally current thread. @throws PSQLException when already holding the lock or getting interrupted.
[ "Obtain", "lock", "over", "this", "connection", "for", "given", "object", "blocking", "to", "wait", "if", "necessary", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L162-L170
60,203
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.unlock
private void unlock(Object holder) throws PSQLException { if (lockedFor != holder) { throw new PSQLException(GT.tr("Tried to break lock on database connection"), PSQLState.OBJECT_NOT_IN_STATE); } lockedFor = null; this.notify(); }
java
private void unlock(Object holder) throws PSQLException { if (lockedFor != holder) { throw new PSQLException(GT.tr("Tried to break lock on database connection"), PSQLState.OBJECT_NOT_IN_STATE); } lockedFor = null; this.notify(); }
[ "private", "void", "unlock", "(", "Object", "holder", ")", "throws", "PSQLException", "{", "if", "(", "lockedFor", "!=", "holder", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Tried to break lock on database connection\"", ")", ",", ...
Release lock on this connection presumably held by given object. @param holder object that holds the lock. Normally current thread. @throws PSQLException when this thread does not hold the lock
[ "Release", "lock", "on", "this", "connection", "presumably", "held", "by", "given", "object", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L178-L185
60,204
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.waitOnLock
private void waitOnLock() throws PSQLException { while (lockedFor != null) { try { this.wait(); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new PSQLException( GT.tr("Interrupted while waiting to obtain lock on database connection"), ...
java
private void waitOnLock() throws PSQLException { while (lockedFor != null) { try { this.wait(); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new PSQLException( GT.tr("Interrupted while waiting to obtain lock on database connection"), ...
[ "private", "void", "waitOnLock", "(", ")", "throws", "PSQLException", "{", "while", "(", "lockedFor", "!=", "null", ")", "{", "try", "{", "this", ".", "wait", "(", ")", ";", "}", "catch", "(", "InterruptedException", "ie", ")", "{", "Thread", ".", "cur...
Wait until our lock is released. Execution of a single synchronized method can then continue without further ado. Must be called at beginning of each synchronized public method.
[ "Wait", "until", "our", "lock", "is", "released", ".", "Execution", "of", "a", "single", "synchronized", "method", "can", "then", "continue", "without", "further", "ado", ".", "Must", "be", "called", "at", "beginning", "of", "each", "synchronized", "public", ...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L191-L202
60,205
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.startCopy
public synchronized CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException { waitOnLock(); if (!suppressBegin) { doSubprotocolBegin(); } byte[] buf = Utils.encodeUTF8(sql); try { LOGGER.log(Level.FINEST, " FE=> Query(CopyStart)"); pgStream.sendChar('...
java
public synchronized CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException { waitOnLock(); if (!suppressBegin) { doSubprotocolBegin(); } byte[] buf = Utils.encodeUTF8(sql); try { LOGGER.log(Level.FINEST, " FE=> Query(CopyStart)"); pgStream.sendChar('...
[ "public", "synchronized", "CopyOperation", "startCopy", "(", "String", "sql", ",", "boolean", "suppressBegin", ")", "throws", "SQLException", "{", "waitOnLock", "(", ")", ";", "if", "(", "!", "suppressBegin", ")", "{", "doSubprotocolBegin", "(", ")", ";", "}",...
Sends given query to BE to start, initialize and lock connection for a CopyOperation. @param sql COPY FROM STDIN / COPY TO STDOUT statement @return CopyIn or CopyOut operation object @throws SQLException on failure
[ "Sends", "given", "query", "to", "BE", "to", "start", "initialize", "and", "lock", "connection", "for", "a", "CopyOperation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L853-L876
60,206
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.initCopy
private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException { pgStream.receiveInteger4(); // length not used int rowFormat = pgStream.receiveChar(); int numFields = pgStream.receiveInteger2(); int[] fieldFormats = new int[numFields]; for (int i = 0; i < numFields; i++)...
java
private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException { pgStream.receiveInteger4(); // length not used int rowFormat = pgStream.receiveChar(); int numFields = pgStream.receiveInteger2(); int[] fieldFormats = new int[numFields]; for (int i = 0; i < numFields; i++)...
[ "private", "synchronized", "void", "initCopy", "(", "CopyOperationImpl", "op", ")", "throws", "SQLException", ",", "IOException", "{", "pgStream", ".", "receiveInteger4", "(", ")", ";", "// length not used", "int", "rowFormat", "=", "pgStream", ".", "receiveChar", ...
Locks connection and calls initializer for a new CopyOperation Called via startCopy -> processCopyResults. @param op an uninitialized CopyOperation @throws SQLException on locking failure @throws IOException on database connection failure
[ "Locks", "connection", "and", "calls", "initializer", "for", "a", "new", "CopyOperation", "Called", "via", "startCopy", "-", ">", "processCopyResults", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L886-L898
60,207
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.cancelCopy
public void cancelCopy(CopyOperationImpl op) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to cancel an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } SQLException error = null; int errors = 0; try { if (op instanceof CopyIn) { ...
java
public void cancelCopy(CopyOperationImpl op) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to cancel an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } SQLException error = null; int errors = 0; try { if (op instanceof CopyIn) { ...
[ "public", "void", "cancelCopy", "(", "CopyOperationImpl", "op", ")", "throws", "SQLException", "{", "if", "(", "!", "hasLock", "(", "op", ")", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Tried to cancel an inactive copy operation\"",...
Finishes a copy operation and unlocks connection discarding any exchanged data. @param op the copy operation presumably currently holding lock on this connection @throws SQLException on any additional failure
[ "Finishes", "a", "copy", "operation", "and", "unlocks", "connection", "discarding", "any", "exchanged", "data", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L906-L971
60,208
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.endCopy
public synchronized long endCopy(CopyOperationImpl op) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to end inactive copy"), PSQLState.OBJECT_NOT_IN_STATE); } try { LOGGER.log(Level.FINEST, " FE=> CopyDone"); pgStream.sendChar('c'); // CopyDone pgSt...
java
public synchronized long endCopy(CopyOperationImpl op) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to end inactive copy"), PSQLState.OBJECT_NOT_IN_STATE); } try { LOGGER.log(Level.FINEST, " FE=> CopyDone"); pgStream.sendChar('c'); // CopyDone pgSt...
[ "public", "synchronized", "long", "endCopy", "(", "CopyOperationImpl", "op", ")", "throws", "SQLException", "{", "if", "(", "!", "hasLock", "(", "op", ")", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Tried to end inactive copy\"", ...
Finishes writing to copy and unlocks connection. @param op the copy operation presumably currently holding lock on this connection @return number of rows updated for server versions 8.2 or newer @throws SQLException on failure
[ "Finishes", "writing", "to", "copy", "and", "unlocks", "connection", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L980-L1000
60,209
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
QueryExecutorImpl.writeToCopy
public synchronized void writeToCopy(CopyOperationImpl op, byte[] data, int off, int siz) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } LOGGER.log(Level.FINEST, " FE=> CopyData...
java
public synchronized void writeToCopy(CopyOperationImpl op, byte[] data, int off, int siz) throws SQLException { if (!hasLock(op)) { throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } LOGGER.log(Level.FINEST, " FE=> CopyData...
[ "public", "synchronized", "void", "writeToCopy", "(", "CopyOperationImpl", "op", ",", "byte", "[", "]", "data", ",", "int", "off", ",", "int", "siz", ")", "throws", "SQLException", "{", "if", "(", "!", "hasLock", "(", "op", ")", ")", "{", "throw", "new...
Sends data during a live COPY IN operation. Only unlocks the connection if server suddenly returns CommandComplete, which should not happen @param op the CopyIn operation presumably currently holding lock on this connection @param data bytes to send @param off index of first byte to send (usually 0) @param siz number ...
[ "Sends", "data", "during", "a", "live", "COPY", "IN", "operation", ".", "Only", "unlocks", "the", "connection", "if", "server", "suddenly", "returns", "CommandComplete", "which", "should", "not", "happen" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L1012-L1031
60,210
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Utils.java
Utils.toHexString
public static String toHexString(byte[] data) { StringBuilder sb = new StringBuilder(data.length * 2); for (byte element : data) { sb.append(Integer.toHexString((element >> 4) & 15)); sb.append(Integer.toHexString(element & 15)); } return sb.toString(); }
java
public static String toHexString(byte[] data) { StringBuilder sb = new StringBuilder(data.length * 2); for (byte element : data) { sb.append(Integer.toHexString((element >> 4) & 15)); sb.append(Integer.toHexString(element & 15)); } return sb.toString(); }
[ "public", "static", "String", "toHexString", "(", "byte", "[", "]", "data", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "data", ".", "length", "*", "2", ")", ";", "for", "(", "byte", "element", ":", "data", ")", "{", "sb", ".",...
Turn a bytearray into a printable form, representing each byte in hex. @param data the bytearray to stringize @return a hex-encoded printable representation of {@code data}
[ "Turn", "a", "bytearray", "into", "a", "printable", "form", "representing", "each", "byte", "in", "hex", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Utils.java#L27-L34
60,211
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Utils.java
Utils.doAppendEscapedIdentifier
private static void doAppendEscapedIdentifier(Appendable sbuf, String value) throws SQLException { try { sbuf.append('"'); for (int i = 0; i < value.length(); ++i) { char ch = value.charAt(i); if (ch == '\0') { throw new PSQLException(GT.tr("Zero bytes may not occur in identif...
java
private static void doAppendEscapedIdentifier(Appendable sbuf, String value) throws SQLException { try { sbuf.append('"'); for (int i = 0; i < value.length(); ++i) { char ch = value.charAt(i); if (ch == '\0') { throw new PSQLException(GT.tr("Zero bytes may not occur in identif...
[ "private", "static", "void", "doAppendEscapedIdentifier", "(", "Appendable", "sbuf", ",", "String", "value", ")", "throws", "SQLException", "{", "try", "{", "sbuf", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<"...
Common part for appendEscapedIdentifier. @param sbuf Either StringBuffer or StringBuilder as we do not expect any IOException to be thrown. @param value value to append
[ "Common", "part", "for", "appendEscapedIdentifier", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Utils.java#L152-L173
60,212
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java
Fastpath.getInteger
public int getInteger(String name, FastpathArg[] args) throws SQLException { byte[] returnValue = fastpath(name, args); if (returnValue == null) { throw new PSQLException( GT.tr("Fastpath call {0} - No result was returned and we expected an integer.", name), PSQLState.NO_DATA); } ...
java
public int getInteger(String name, FastpathArg[] args) throws SQLException { byte[] returnValue = fastpath(name, args); if (returnValue == null) { throw new PSQLException( GT.tr("Fastpath call {0} - No result was returned and we expected an integer.", name), PSQLState.NO_DATA); } ...
[ "public", "int", "getInteger", "(", "String", "name", ",", "FastpathArg", "[", "]", "args", ")", "throws", "SQLException", "{", "byte", "[", "]", "returnValue", "=", "fastpath", "(", "name", ",", "args", ")", ";", "if", "(", "returnValue", "==", "null", ...
This convenience method assumes that the return value is an integer. @param name Function name @param args Function arguments @return integer result @throws SQLException if a database-access error occurs or no result
[ "This", "convenience", "method", "assumes", "that", "the", "return", "value", "is", "an", "integer", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L157-L172
60,213
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java
Fastpath.getOID
public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) { oid += NUM_OIDS; } return oid; }
java
public long getOID(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) { oid += NUM_OIDS; } return oid; }
[ "public", "long", "getOID", "(", "String", "name", ",", "FastpathArg", "[", "]", "args", ")", "throws", "SQLException", "{", "long", "oid", "=", "getInteger", "(", "name", ",", "args", ")", ";", "if", "(", "oid", "<", "0", ")", "{", "oid", "+=", "N...
This convenience method assumes that the return value is an oid. @param name Function name @param args Function arguments @return oid of the given call @throws SQLException if a database-access error occurs or no result
[ "This", "convenience", "method", "assumes", "that", "the", "return", "value", "is", "an", "oid", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L208-L214
60,214
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java
Fastpath.createOIDArg
public static FastpathArg createOIDArg(long oid) { if (oid > Integer.MAX_VALUE) { oid -= NUM_OIDS; } return new FastpathArg((int) oid); }
java
public static FastpathArg createOIDArg(long oid) { if (oid > Integer.MAX_VALUE) { oid -= NUM_OIDS; } return new FastpathArg((int) oid); }
[ "public", "static", "FastpathArg", "createOIDArg", "(", "long", "oid", ")", "{", "if", "(", "oid", ">", "Integer", ".", "MAX_VALUE", ")", "{", "oid", "-=", "NUM_OIDS", ";", "}", "return", "new", "FastpathArg", "(", "(", "int", ")", "oid", ")", ";", "...
Creates a FastpathArg with an oid parameter. This is here instead of a constructor of FastpathArg because the constructor can't tell the difference between an long that's really int8 and a long thats an oid. @param oid input oid @return FastpathArg with an oid parameter
[ "Creates", "a", "FastpathArg", "with", "an", "oid", "parameter", ".", "This", "is", "here", "instead", "of", "a", "constructor", "of", "FastpathArg", "because", "the", "constructor", "can", "t", "tell", "the", "difference", "between", "an", "long", "that", "...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L312-L317
60,215
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/common/PGObjectFactory.java
PGObjectFactory.getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { Reference ref = (Reference) obj; String className = ref.getClassName(); // Old names are here for those who still use them if (className.equals("org.postgresql.ds.PGSimpleDataSou...
java
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { Reference ref = (Reference) obj; String className = ref.getClassName(); // Old names are here for those who still use them if (className.equals("org.postgresql.ds.PGSimpleDataSou...
[ "public", "Object", "getObjectInstance", "(", "Object", "obj", ",", "Name", "name", ",", "Context", "nameCtx", ",", "Hashtable", "<", "?", ",", "?", ">", "environment", ")", "throws", "Exception", "{", "Reference", "ref", "=", "(", "Reference", ")", "obj",...
Dereferences a PostgreSQL DataSource. Other types of references are ignored.
[ "Dereferences", "a", "PostgreSQL", "DataSource", ".", "Other", "types", "of", "references", "are", "ignored", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/common/PGObjectFactory.java#L33-L53
60,216
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java
PGPoolingDataSource.setDataSourceName
public void setDataSourceName(String dataSourceName) { if (initialized) { throw new IllegalStateException( "Cannot set Data Source properties after DataSource has been used"); } if (this.dataSourceName != null && dataSourceName != null && dataSourceName.equals(this.dataSourceName)) {...
java
public void setDataSourceName(String dataSourceName) { if (initialized) { throw new IllegalStateException( "Cannot set Data Source properties after DataSource has been used"); } if (this.dataSourceName != null && dataSourceName != null && dataSourceName.equals(this.dataSourceName)) {...
[ "public", "void", "setDataSourceName", "(", "String", "dataSourceName", ")", "{", "if", "(", "initialized", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot set Data Source properties after DataSource has been used\"", ")", ";", "}", "if", "(", "this", ...
Sets the name of this DataSource. This is required, and uniquely identifies the DataSource. You cannot create or use more than one DataSource in the same VM with the same name. @param dataSourceName datasource name @throws IllegalStateException The Data Source Name cannot be changed after the DataSource has been used....
[ "Sets", "the", "name", "of", "this", "DataSource", ".", "This", "is", "required", "and", "uniquely", "identifies", "the", "DataSource", ".", "You", "cannot", "create", "or", "use", "more", "than", "one", "DataSource", "in", "the", "same", "VM", "with", "th...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L234-L252
60,217
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java
PGPoolingDataSource.initialize
public void initialize() throws SQLException { synchronized (lock) { source = createConnectionPool(); try { source.initializeFrom(this); } catch (Exception e) { throw new PSQLException(GT.tr("Failed to setup DataSource."), PSQLState.UNEXPECTED_ERROR, e); } ...
java
public void initialize() throws SQLException { synchronized (lock) { source = createConnectionPool(); try { source.initializeFrom(this); } catch (Exception e) { throw new PSQLException(GT.tr("Failed to setup DataSource."), PSQLState.UNEXPECTED_ERROR, e); } ...
[ "public", "void", "initialize", "(", ")", "throws", "SQLException", "{", "synchronized", "(", "lock", ")", "{", "source", "=", "createConnectionPool", "(", ")", ";", "try", "{", "source", ".", "initializeFrom", "(", "this", ")", ";", "}", "catch", "(", "...
Initializes this DataSource. If the initialConnections is greater than zero, that number of connections will be created. After this method is called, the DataSource properties cannot be changed. If you do not call this explicitly, it will be called the first time you get a connection from the DataSource. @throws SQLEx...
[ "Initializes", "this", "DataSource", ".", "If", "the", "initialConnections", "is", "greater", "than", "zero", "that", "number", "of", "connections", "will", "be", "created", ".", "After", "this", "method", "is", "called", "the", "DataSource", "properties", "cann...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L263-L279
60,218
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java
PGPoolingDataSource.close
public void close() { synchronized (lock) { while (!available.isEmpty()) { PooledConnection pci = available.pop(); try { pci.close(); } catch (SQLException e) { } } available = null; while (!used.isEmpty()) { PooledConnection pci = used.pop()...
java
public void close() { synchronized (lock) { while (!available.isEmpty()) { PooledConnection pci = available.pop(); try { pci.close(); } catch (SQLException e) { } } available = null; while (!used.isEmpty()) { PooledConnection pci = used.pop()...
[ "public", "void", "close", "(", ")", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "!", "available", ".", "isEmpty", "(", ")", ")", "{", "PooledConnection", "pci", "=", "available", ".", "pop", "(", ")", ";", "try", "{", "pci", ".", "cl...
Closes this DataSource, and all the pooled connections, whether in use or not.
[ "Closes", "this", "DataSource", "and", "all", "the", "pooled", "connections", "whether", "in", "use", "or", "not", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L332-L353
60,219
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java
PGPoolingDataSource.getPooledConnection
private Connection getPooledConnection() throws SQLException { PooledConnection pc = null; synchronized (lock) { if (available == null) { throw new PSQLException(GT.tr("DataSource has been closed."), PSQLState.CONNECTION_DOES_NOT_EXIST); } while (true) { if (!availa...
java
private Connection getPooledConnection() throws SQLException { PooledConnection pc = null; synchronized (lock) { if (available == null) { throw new PSQLException(GT.tr("DataSource has been closed."), PSQLState.CONNECTION_DOES_NOT_EXIST); } while (true) { if (!availa...
[ "private", "Connection", "getPooledConnection", "(", ")", "throws", "SQLException", "{", "PooledConnection", "pc", "=", "null", ";", "synchronized", "(", "lock", ")", "{", "if", "(", "available", "==", "null", ")", "{", "throw", "new", "PSQLException", "(", ...
Gets a connection from the pool. Will get an available one if present, or create a new one if under the max limit. Will block if all used and a new one would exceed the max.
[ "Gets", "a", "connection", "from", "the", "pool", ".", "Will", "get", "an", "available", "one", "if", "present", "or", "create", "a", "new", "one", "if", "under", "the", "max", "limit", ".", "Will", "block", "if", "all", "used", "and", "a", "new", "o...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L367-L395
60,220
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java
PGPoolingDataSource.getReference
public Reference getReference() throws NamingException { Reference ref = super.getReference(); ref.add(new StringRefAddr("dataSourceName", dataSourceName)); if (initialConnections > 0) { ref.add(new StringRefAddr("initialConnections", Integer.toString(initialConnections))); } if (maxConnection...
java
public Reference getReference() throws NamingException { Reference ref = super.getReference(); ref.add(new StringRefAddr("dataSourceName", dataSourceName)); if (initialConnections > 0) { ref.add(new StringRefAddr("initialConnections", Integer.toString(initialConnections))); } if (maxConnection...
[ "public", "Reference", "getReference", "(", ")", "throws", "NamingException", "{", "Reference", "ref", "=", "super", ".", "getReference", "(", ")", ";", "ref", ".", "add", "(", "new", "StringRefAddr", "(", "\"dataSourceName\"", ",", "dataSourceName", ")", ")",...
Adds custom properties for this DataSource to the properties defined in the superclass.
[ "Adds", "custom", "properties", "for", "this", "DataSource", "to", "the", "properties", "defined", "in", "the", "superclass", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L439-L449
60,221
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/SimpleQuery.java
SimpleQuery.setFields
void setFields(Field[] fields) { this.fields = fields; this.resultSetColumnNameIndexMap = null; this.cachedMaxResultRowSize = null; this.needUpdateFieldFormats = fields != null; this.hasBinaryFields = false; // just in case }
java
void setFields(Field[] fields) { this.fields = fields; this.resultSetColumnNameIndexMap = null; this.cachedMaxResultRowSize = null; this.needUpdateFieldFormats = fields != null; this.hasBinaryFields = false; // just in case }
[ "void", "setFields", "(", "Field", "[", "]", "fields", ")", "{", "this", ".", "fields", "=", "fields", ";", "this", ".", "resultSetColumnNameIndexMap", "=", "null", ";", "this", ".", "cachedMaxResultRowSize", "=", "null", ";", "this", ".", "needUpdateFieldFo...
Sets the fields that this query will return. @param fields The fields that this query will return.
[ "Sets", "the", "fields", "that", "this", "query", "will", "return", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/SimpleQuery.java#L216-L222
60,222
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.toTimestamp
public synchronized Timestamp toTimestamp(Calendar cal, String s) throws SQLException { if (s == null) { return null; } int slen = s.length(); // convert postgres's infinity values to internal infinity magic value if (slen == 8 && s.equals("infinity")) { return new Timestamp(PGStatemen...
java
public synchronized Timestamp toTimestamp(Calendar cal, String s) throws SQLException { if (s == null) { return null; } int slen = s.length(); // convert postgres's infinity values to internal infinity magic value if (slen == 8 && s.equals("infinity")) { return new Timestamp(PGStatemen...
[ "public", "synchronized", "Timestamp", "toTimestamp", "(", "Calendar", "cal", ",", "String", "s", ")", "throws", "SQLException", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "int", "slen", "=", "s", ".", "length", "(", ")", ...
Parse a string and return a timestamp representing its value. @param cal calendar to be used to parse the input string @param s The ISO formated date string to parse. @return null if s is null or a timestamp of the parsed string s. @throws SQLException if there is a problem parsing s.
[ "Parse", "a", "string", "and", "return", "a", "timestamp", "representing", "its", "value", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L379-L409
60,223
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.toLocalTime
public LocalTime toLocalTime(String s) throws SQLException { if (s == null) { return null; } if (s.equals("24:00:00")) { return LocalTime.MAX; } try { return LocalTime.parse(s); } catch (DateTimeParseException nfe) { throw new PSQLException( GT.tr("Bad value f...
java
public LocalTime toLocalTime(String s) throws SQLException { if (s == null) { return null; } if (s.equals("24:00:00")) { return LocalTime.MAX; } try { return LocalTime.parse(s); } catch (DateTimeParseException nfe) { throw new PSQLException( GT.tr("Bad value f...
[ "public", "LocalTime", "toLocalTime", "(", "String", "s", ")", "throws", "SQLException", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "s", ".", "equals", "(", "\"24:00:00\"", ")", ")", "{", "return", "LocalTime", ...
Parse a string and return a LocalTime representing its value. @param s The ISO formated time string to parse. @return null if s is null or a LocalTime of the parsed string s. @throws SQLException if there is a problem parsing s.
[ "Parse", "a", "string", "and", "return", "a", "LocalTime", "representing", "its", "value", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L419-L436
60,224
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.toLocalDateTime
public LocalDateTime toLocalDateTime(String s) throws SQLException { if (s == null) { return null; } int slen = s.length(); // convert postgres's infinity values to internal infinity magic value if (slen == 8 && s.equals("infinity")) { return LocalDateTime.MAX; } if (slen == 9...
java
public LocalDateTime toLocalDateTime(String s) throws SQLException { if (s == null) { return null; } int slen = s.length(); // convert postgres's infinity values to internal infinity magic value if (slen == 8 && s.equals("infinity")) { return LocalDateTime.MAX; } if (slen == 9...
[ "public", "LocalDateTime", "toLocalDateTime", "(", "String", "s", ")", "throws", "SQLException", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "int", "slen", "=", "s", ".", "length", "(", ")", ";", "// convert postgres's infinity...
Parse a string and return a LocalDateTime representing its value. @param s The ISO formated date string to parse. @return null if s is null or a LocalDateTime of the parsed string s. @throws SQLException if there is a problem parsing s.
[ "Parse", "a", "string", "and", "return", "a", "LocalDateTime", "representing", "its", "value", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L445-L471
60,225
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.getSharedCalendar
public Calendar getSharedCalendar(TimeZone timeZone) { if (timeZone == null) { timeZone = getDefaultTz(); } Calendar tmp = calendarWithUserTz; tmp.setTimeZone(timeZone); return tmp; }
java
public Calendar getSharedCalendar(TimeZone timeZone) { if (timeZone == null) { timeZone = getDefaultTz(); } Calendar tmp = calendarWithUserTz; tmp.setTimeZone(timeZone); return tmp; }
[ "public", "Calendar", "getSharedCalendar", "(", "TimeZone", "timeZone", ")", "{", "if", "(", "timeZone", "==", "null", ")", "{", "timeZone", "=", "getDefaultTz", "(", ")", ";", "}", "Calendar", "tmp", "=", "calendarWithUserTz", ";", "tmp", ".", "setTimeZone"...
Get a shared calendar, applying the supplied time zone or the default time zone if null. @param timeZone time zone to be set for the calendar @return The shared calendar.
[ "Get", "a", "shared", "calendar", "applying", "the", "supplied", "time", "zone", "or", "the", "default", "time", "zone", "if", "null", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L541-L548
60,226
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.convertToDate
public Date convertToDate(long millis, TimeZone tz) { // no adjustments for the inifity hack values if (millis <= PGStatement.DATE_NEGATIVE_INFINITY || millis >= PGStatement.DATE_POSITIVE_INFINITY) { return new Date(millis); } if (tz == null) { tz = getDefaultTz(); } if (isS...
java
public Date convertToDate(long millis, TimeZone tz) { // no adjustments for the inifity hack values if (millis <= PGStatement.DATE_NEGATIVE_INFINITY || millis >= PGStatement.DATE_POSITIVE_INFINITY) { return new Date(millis); } if (tz == null) { tz = getDefaultTz(); } if (isS...
[ "public", "Date", "convertToDate", "(", "long", "millis", ",", "TimeZone", "tz", ")", "{", "// no adjustments for the inifity hack values", "if", "(", "millis", "<=", "PGStatement", ".", "DATE_NEGATIVE_INFINITY", "||", "millis", ">=", "PGStatement", ".", "DATE_POSITIV...
Extracts the date part from a timestamp. @param millis The timestamp from which to extract the date. @param tz The time zone of the date. @return The extracted date.
[ "Extracts", "the", "date", "part", "from", "a", "timestamp", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1225-L1259
60,227
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.convertToTime
public Time convertToTime(long millis, TimeZone tz) { if (tz == null) { tz = getDefaultTz(); } if (isSimpleTimeZone(tz.getID())) { // Leave just time part of the day. // Suppose the input date is 2015 7 Jan 15:40 GMT+02:00 (that is 13:40 UTC) // We want it to become 1970 1 Jan 15:40 ...
java
public Time convertToTime(long millis, TimeZone tz) { if (tz == null) { tz = getDefaultTz(); } if (isSimpleTimeZone(tz.getID())) { // Leave just time part of the day. // Suppose the input date is 2015 7 Jan 15:40 GMT+02:00 (that is 13:40 UTC) // We want it to become 1970 1 Jan 15:40 ...
[ "public", "Time", "convertToTime", "(", "long", "millis", ",", "TimeZone", "tz", ")", "{", "if", "(", "tz", "==", "null", ")", "{", "tz", "=", "getDefaultTz", "(", ")", ";", "}", "if", "(", "isSimpleTimeZone", "(", "tz", ".", "getID", "(", ")", ")"...
Extracts the time part from a timestamp. This method ensures the date part of output timestamp looks like 1970-01-01 in given timezone. @param millis The timestamp from which to extract the time. @param tz timezone to use. @return The extracted time.
[ "Extracts", "the", "time", "part", "from", "a", "timestamp", ".", "This", "method", "ensures", "the", "date", "part", "of", "output", "timestamp", "looks", "like", "1970", "-", "01", "-", "01", "in", "given", "timezone", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1269-L1297
60,228
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java
TimestampUtils.timeToString
public String timeToString(java.util.Date time, boolean withTimeZone) { Calendar cal = null; if (withTimeZone) { cal = calendarWithUserTz; cal.setTimeZone(timeZoneProvider.get()); } if (time instanceof Timestamp) { return toString(cal, (Timestamp) time, withTimeZone); } if (tim...
java
public String timeToString(java.util.Date time, boolean withTimeZone) { Calendar cal = null; if (withTimeZone) { cal = calendarWithUserTz; cal.setTimeZone(timeZoneProvider.get()); } if (time instanceof Timestamp) { return toString(cal, (Timestamp) time, withTimeZone); } if (tim...
[ "public", "String", "timeToString", "(", "java", ".", "util", ".", "Date", "time", ",", "boolean", "withTimeZone", ")", "{", "Calendar", "cal", "=", "null", ";", "if", "(", "withTimeZone", ")", "{", "cal", "=", "calendarWithUserTz", ";", "cal", ".", "set...
Returns the given time value as String matching what the current postgresql server would send in text mode. @param time time value @param withTimeZone whether timezone should be added @return given time value as String
[ "Returns", "the", "given", "time", "value", "as", "String", "matching", "what", "the", "current", "postgresql", "server", "would", "send", "in", "text", "mode", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1307-L1320
60,229
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/xa/PGXADataSource.java
PGXADataSource.getXAConnection
public XAConnection getXAConnection(String user, String password) throws SQLException { Connection con = super.getConnection(user, password); return new PGXAConnection((BaseConnection) con); }
java
public XAConnection getXAConnection(String user, String password) throws SQLException { Connection con = super.getConnection(user, password); return new PGXAConnection((BaseConnection) con); }
[ "public", "XAConnection", "getXAConnection", "(", "String", "user", ",", "String", "password", ")", "throws", "SQLException", "{", "Connection", "con", "=", "super", ".", "getConnection", "(", "user", ",", "password", ")", ";", "return", "new", "PGXAConnection",...
Gets a XA-enabled connection to the PostgreSQL database. The database is identified by the DataSource properties serverName, databaseName, and portNumber. The user to connect as is identified by the arguments user and password, which override the DataSource properties by the same name. @return A valid database connect...
[ "Gets", "a", "XA", "-", "enabled", "connection", "to", "the", "PostgreSQL", "database", ".", "The", "database", "is", "identified", "by", "the", "DataSource", "properties", "serverName", "databaseName", "and", "portNumber", ".", "The", "user", "to", "connect", ...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/xa/PGXADataSource.java#L45-L48
60,230
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java
CopyManager.copyOut
public long copyOut(final String sql, Writer to) throws SQLException, IOException { byte[] buf; CopyOut cp = copyOut(sql); try { while ((buf = cp.readFromCopy()) != null) { to.write(encoding.decode(buf)); } return cp.getHandledRowCount(); } catch (IOException ioEX) { // i...
java
public long copyOut(final String sql, Writer to) throws SQLException, IOException { byte[] buf; CopyOut cp = copyOut(sql); try { while ((buf = cp.readFromCopy()) != null) { to.write(encoding.decode(buf)); } return cp.getHandledRowCount(); } catch (IOException ioEX) { // i...
[ "public", "long", "copyOut", "(", "final", "String", "sql", ",", "Writer", "to", ")", "throws", "SQLException", ",", "IOException", "{", "byte", "[", "]", "buf", ";", "CopyOut", "cp", "=", "copyOut", "(", "sql", ")", ";", "try", "{", "while", "(", "(...
Pass results of a COPY TO STDOUT query from database into a Writer. @param sql COPY TO STDOUT statement @param to the stream to write the results to (row by row) @return number of rows updated for server 8.2 or newer; -1 for older @throws SQLException on database usage errors @throws IOException upon writer or databas...
[ "Pass", "results", "of", "a", "COPY", "TO", "STDOUT", "query", "from", "database", "into", "a", "Writer", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java#L85-L109
60,231
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSetMetaData.java
PgResultSetMetaData.getColumnClassName
public String getColumnClassName(int column) throws SQLException { Field field = getField(column); String result = connection.getTypeInfo().getJavaClass(field.getOID()); if (result != null) { return result; } int sqlType = getSQLType(column); switch (sqlType) { case Types.ARRAY: ...
java
public String getColumnClassName(int column) throws SQLException { Field field = getField(column); String result = connection.getTypeInfo().getJavaClass(field.getOID()); if (result != null) { return result; } int sqlType = getSQLType(column); switch (sqlType) { case Types.ARRAY: ...
[ "public", "String", "getColumnClassName", "(", "int", "column", ")", "throws", "SQLException", "{", "Field", "field", "=", "getField", "(", "column", ")", ";", "String", "result", "=", "connection", ".", "getTypeInfo", "(", ")", ".", "getJavaClass", "(", "fi...
This can hook into our PG_Object mechanism
[ "This", "can", "hook", "into", "our", "PG_Object", "mechanism" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSetMetaData.java#L408-L427
60,232
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/Driver.java
Driver.makeConnection
private static Connection makeConnection(String url, Properties props) throws SQLException { return new PgConnection(hostSpecs(props), user(props), database(props), props, url); }
java
private static Connection makeConnection(String url, Properties props) throws SQLException { return new PgConnection(hostSpecs(props), user(props), database(props), props, url); }
[ "private", "static", "Connection", "makeConnection", "(", "String", "url", ",", "Properties", "props", ")", "throws", "SQLException", "{", "return", "new", "PgConnection", "(", "hostSpecs", "(", "props", ")", ",", "user", "(", "props", ")", ",", "database", ...
Create a connection from URL and properties. Always does the connection work in the current thread without enforcing a timeout, regardless of any timeout specified in the properties. @param url the original URL @param props the parsed/defaulted connection properties @return a new connection @throws SQLException if the...
[ "Create", "a", "connection", "from", "URL", "and", "properties", ".", "Always", "does", "the", "connection", "work", "in", "the", "current", "thread", "without", "enforcing", "a", "timeout", "regardless", "of", "any", "timeout", "specified", "in", "the", "prop...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/Driver.java#L457-L459
60,233
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/Driver.java
Driver.notImplemented
public static SQLFeatureNotSupportedException notImplemented(Class<?> callClass, String functionName) { return new SQLFeatureNotSupportedException( GT.tr("Method {0} is not yet implemented.", callClass.getName() + "." + functionName), PSQLState.NOT_IMPLEMENTED.getState()); }
java
public static SQLFeatureNotSupportedException notImplemented(Class<?> callClass, String functionName) { return new SQLFeatureNotSupportedException( GT.tr("Method {0} is not yet implemented.", callClass.getName() + "." + functionName), PSQLState.NOT_IMPLEMENTED.getState()); }
[ "public", "static", "SQLFeatureNotSupportedException", "notImplemented", "(", "Class", "<", "?", ">", "callClass", ",", "String", "functionName", ")", "{", "return", "new", "SQLFeatureNotSupportedException", "(", "GT", ".", "tr", "(", "\"Method {0} is not yet implemente...
This method was added in v6.5, and simply throws an SQLException for an unimplemented method. I decided to do it this way while implementing the JDBC2 extensions to JDBC, as it should help keep the overall driver size down. It now requires the call Class and the function name to help when the driver is used with closed...
[ "This", "method", "was", "added", "in", "v6", ".", "5", "and", "simply", "throws", "an", "SQLException", "for", "an", "unimplemented", "method", ".", "I", "decided", "to", "do", "it", "this", "way", "while", "implementing", "the", "JDBC2", "extensions", "t...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/Driver.java#L688-L693
60,234
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
PGInterval.setValue
public void setValue(int years, int months, int days, int hours, int minutes, double seconds) { setYears(years); setMonths(months); setDays(days); setHours(hours); setMinutes(minutes); setSeconds(seconds); }
java
public void setValue(int years, int months, int days, int hours, int minutes, double seconds) { setYears(years); setMonths(months); setDays(days); setHours(hours); setMinutes(minutes); setSeconds(seconds); }
[ "public", "void", "setValue", "(", "int", "years", ",", "int", "months", ",", "int", "days", ",", "int", "hours", ",", "int", "minutes", ",", "double", "seconds", ")", "{", "setYears", "(", "years", ")", ";", "setMonths", "(", "months", ")", ";", "se...
Set all values of this interval to the specified values. @param years years @param months months @param days days @param hours hours @param minutes minutes @param seconds seconds
[ "Set", "all", "values", "of", "this", "interval", "to", "the", "specified", "values", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/PGInterval.java#L174-L181
60,235
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
PGInterval.getValue
public String getValue() { return years + " years " + months + " mons " + days + " days " + hours + " hours " + minutes + " mins " + secondsFormat.format(seconds) + " secs"; }
java
public String getValue() { return years + " years " + months + " mons " + days + " days " + hours + " hours " + minutes + " mins " + secondsFormat.format(seconds) + " secs"; }
[ "public", "String", "getValue", "(", ")", "{", "return", "years", "+", "\" years \"", "+", "months", "+", "\" mons \"", "+", "days", "+", "\" days \"", "+", "hours", "+", "\" hours \"", "+", "minutes", "+", "\" mins \"", "+", "secondsFormat", ".", "format", ...
Returns the stored interval information as a string. @return String represented interval
[ "Returns", "the", "stored", "interval", "information", "as", "a", "string", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/PGInterval.java#L188-L195
60,236
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
PGInterval.add
public void add(Calendar cal) { // Avoid precision loss // Be aware postgres doesn't return more than 60 seconds - no overflow can happen final int microseconds = (int) (getSeconds() * 1000000.0); final int milliseconds = (microseconds + ((microseconds < 0) ? -500 : 500)) / 1000; cal.add(Calendar.M...
java
public void add(Calendar cal) { // Avoid precision loss // Be aware postgres doesn't return more than 60 seconds - no overflow can happen final int microseconds = (int) (getSeconds() * 1000000.0); final int milliseconds = (microseconds + ((microseconds < 0) ? -500 : 500)) / 1000; cal.add(Calendar.M...
[ "public", "void", "add", "(", "Calendar", "cal", ")", "{", "// Avoid precision loss", "// Be aware postgres doesn't return more than 60 seconds - no overflow can happen", "final", "int", "microseconds", "=", "(", "int", ")", "(", "getSeconds", "(", ")", "*", "1000000.0", ...
Rolls this interval on a given calendar. @param cal Calendar instance to add to
[ "Rolls", "this", "interval", "on", "a", "given", "calendar", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/PGInterval.java#L310-L322
60,237
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
PGInterval.add
public void add(Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); add(cal); date.setTime(cal.getTime().getTime()); }
java
public void add(Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); add(cal); date.setTime(cal.getTime().getTime()); }
[ "public", "void", "add", "(", "Date", "date", ")", "{", "final", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "cal", ".", "setTime", "(", "date", ")", ";", "add", "(", "cal", ")", ";", "date", ".", "setTime", "(", "cal", ...
Rolls this interval on a given date. @param date Date instance to add to
[ "Rolls", "this", "interval", "on", "a", "given", "date", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/PGInterval.java#L329-L334
60,238
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/PGInterval.java
PGInterval.add
public void add(PGInterval interval) { interval.setYears(interval.getYears() + getYears()); interval.setMonths(interval.getMonths() + getMonths()); interval.setDays(interval.getDays() + getDays()); interval.setHours(interval.getHours() + getHours()); interval.setMinutes(interval.getMinutes() + getMi...
java
public void add(PGInterval interval) { interval.setYears(interval.getYears() + getYears()); interval.setMonths(interval.getMonths() + getMonths()); interval.setDays(interval.getDays() + getDays()); interval.setHours(interval.getHours() + getHours()); interval.setMinutes(interval.getMinutes() + getMi...
[ "public", "void", "add", "(", "PGInterval", "interval", ")", "{", "interval", ".", "setYears", "(", "interval", ".", "getYears", "(", ")", "+", "getYears", "(", ")", ")", ";", "interval", ".", "setMonths", "(", "interval", ".", "getMonths", "(", ")", "...
Add this interval's value to the passed interval. This is backwards to what I would expect, but this makes it match the other existing add methods. @param interval intval to add
[ "Add", "this", "interval", "s", "value", "to", "the", "passed", "interval", ".", "This", "is", "backwards", "to", "what", "I", "would", "expect", "but", "this", "makes", "it", "match", "the", "other", "existing", "add", "methods", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/PGInterval.java#L342-L349
60,239
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
PgConnection.addWarning
public void addWarning(SQLWarning warn) { // Add the warning to the chain if (firstWarning != null) { firstWarning.setNextWarning(warn); } else { firstWarning = warn; } }
java
public void addWarning(SQLWarning warn) { // Add the warning to the chain if (firstWarning != null) { firstWarning.setNextWarning(warn); } else { firstWarning = warn; } }
[ "public", "void", "addWarning", "(", "SQLWarning", "warn", ")", "{", "// Add the warning to the chain", "if", "(", "firstWarning", "!=", "null", ")", "{", "firstWarning", ".", "setNextWarning", "(", "warn", ")", ";", "}", "else", "{", "firstWarning", "=", "war...
This adds a warning to the warning chain. @param warn warning to add
[ "This", "adds", "a", "warning", "to", "the", "warning", "chain", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java#L398-L406
60,240
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
PgConnection.initObjectTypes
private void initObjectTypes(Properties info) throws SQLException { // Add in the types that come packaged with the driver. // These can be overridden later if desired. addDataType("box", org.postgresql.geometric.PGbox.class); addDataType("circle", org.postgresql.geometric.PGcircle.class); addDataTy...
java
private void initObjectTypes(Properties info) throws SQLException { // Add in the types that come packaged with the driver. // These can be overridden later if desired. addDataType("box", org.postgresql.geometric.PGbox.class); addDataType("circle", org.postgresql.geometric.PGcircle.class); addDataTy...
[ "private", "void", "initObjectTypes", "(", "Properties", "info", ")", "throws", "SQLException", "{", "// Add in the types that come packaged with the driver.", "// These can be overridden later if desired.", "addDataType", "(", "\"box\"", ",", "org", ".", "postgresql", ".", "...
This initialises the objectTypes hash map
[ "This", "initialises", "the", "objectTypes", "hash", "map" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java#L618-L651
60,241
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
PgConnection.getServerMajorVersion
public int getServerMajorVersion() { try { StringTokenizer versionTokens = new StringTokenizer(queryExecutor.getServerVersion(), "."); // aaXbb.ccYdd return integerPart(versionTokens.nextToken()); // return X } catch (NoSuchElementException e) { return 0; } }
java
public int getServerMajorVersion() { try { StringTokenizer versionTokens = new StringTokenizer(queryExecutor.getServerVersion(), "."); // aaXbb.ccYdd return integerPart(versionTokens.nextToken()); // return X } catch (NoSuchElementException e) { return 0; } }
[ "public", "int", "getServerMajorVersion", "(", ")", "{", "try", "{", "StringTokenizer", "versionTokens", "=", "new", "StringTokenizer", "(", "queryExecutor", ".", "getServerVersion", "(", ")", ",", "\".\"", ")", ";", "// aaXbb.ccYdd", "return", "integerPart", "(",...
Get server major version. @return server major version
[ "Get", "server", "major", "version", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java#L916-L923
60,242
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
PgConnection.integerPart
private static int integerPart(String dirtyString) { int start = 0; while (start < dirtyString.length() && !Character.isDigit(dirtyString.charAt(start))) { ++start; } int end = start; while (end < dirtyString.length() && Character.isDigit(dirtyString.charAt(end))) { ++end; } i...
java
private static int integerPart(String dirtyString) { int start = 0; while (start < dirtyString.length() && !Character.isDigit(dirtyString.charAt(start))) { ++start; } int end = start; while (end < dirtyString.length() && Character.isDigit(dirtyString.charAt(end))) { ++end; } i...
[ "private", "static", "int", "integerPart", "(", "String", "dirtyString", ")", "{", "int", "start", "=", "0", ";", "while", "(", "start", "<", "dirtyString", ".", "length", "(", ")", "&&", "!", "Character", ".", "isDigit", "(", "dirtyString", ".", "charAt...
Parse a "dirty" integer surrounded by non-numeric characters
[ "Parse", "a", "dirty", "integer", "surrounded", "by", "non", "-", "numeric", "characters" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java#L1189-L1206
60,243
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/replication/LogSequenceNumber.java
LogSequenceNumber.valueOf
public static LogSequenceNumber valueOf(String strValue) { int slashIndex = strValue.lastIndexOf('/'); if (slashIndex <= 0) { return INVALID_LSN; } String logicalXLogStr = strValue.substring(0, slashIndex); int logicalXlog = (int) Long.parseLong(logicalXLogStr, 16); String segmentStr = s...
java
public static LogSequenceNumber valueOf(String strValue) { int slashIndex = strValue.lastIndexOf('/'); if (slashIndex <= 0) { return INVALID_LSN; } String logicalXLogStr = strValue.substring(0, slashIndex); int logicalXlog = (int) Long.parseLong(logicalXLogStr, 16); String segmentStr = s...
[ "public", "static", "LogSequenceNumber", "valueOf", "(", "String", "strValue", ")", "{", "int", "slashIndex", "=", "strValue", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "slashIndex", "<=", "0", ")", "{", "return", "INVALID_LSN", ";", "}", "...
Create LSN instance by string represent LSN. @param strValue not null string as two hexadecimal numbers of up to 8 digits each, separated by a slash. For example {@code 16/3002D50}, {@code 0/15D68C50} @return not null LSN instance where if specified string represent have not valid form {@link LogSequenceNumber#INVALID...
[ "Create", "LSN", "instance", "by", "string", "represent", "LSN", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/replication/LogSequenceNumber.java#L42-L61
60,244
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgClob.java
PgClob.position
public synchronized long position(String pattern, long start) throws SQLException { checkFreed(); throw org.postgresql.Driver.notImplemented(this.getClass(), "position(String,long)"); }
java
public synchronized long position(String pattern, long start) throws SQLException { checkFreed(); throw org.postgresql.Driver.notImplemented(this.getClass(), "position(String,long)"); }
[ "public", "synchronized", "long", "position", "(", "String", "pattern", ",", "long", "start", ")", "throws", "SQLException", "{", "checkFreed", "(", ")", ";", "throw", "org", ".", "postgresql", ".", "Driver", ".", "notImplemented", "(", "this", ".", "getClas...
For now, this is not implemented.
[ "For", "now", "this", "is", "not", "implemented", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgClob.java#L64-L67
60,245
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/BooleanTypeUtil.java
BooleanTypeUtil.castToBoolean
static boolean castToBoolean(final Object in) throws PSQLException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Cast to boolean: \"{0}\"", String.valueOf(in)); } if (in instanceof Boolean) { return (Boolean) in; } if (in instanceof String) { return fromString((Str...
java
static boolean castToBoolean(final Object in) throws PSQLException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Cast to boolean: \"{0}\"", String.valueOf(in)); } if (in instanceof Boolean) { return (Boolean) in; } if (in instanceof String) { return fromString((Str...
[ "static", "boolean", "castToBoolean", "(", "final", "Object", "in", ")", "throws", "PSQLException", "{", "if", "(", "LOGGER", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "LOGGER", ".", "log", "(", "Level", ".", "FINE", ",", "\"Cast to bo...
Cast an Object value to the corresponding boolean value. @param in Object to cast into boolean @return boolean value corresponding to the cast of the object @throws PSQLException PSQLState.CANNOT_COERCE
[ "Cast", "an", "Object", "value", "to", "the", "corresponding", "boolean", "value", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/BooleanTypeUtil.java#L35-L52
60,246
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/UTF8Encoding.java
UTF8Encoding.checkByte
private static void checkByte(int ch, int pos, int len) throws IOException { if ((ch & 0xc0) != 0x80) { throw new IOException( GT.tr("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}", pos, len, ch)); } }
java
private static void checkByte(int ch, int pos, int len) throws IOException { if ((ch & 0xc0) != 0x80) { throw new IOException( GT.tr("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}", pos, len, ch)); } }
[ "private", "static", "void", "checkByte", "(", "int", "ch", ",", "int", "pos", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "(", "ch", "&", "0xc0", ")", "!=", "0x80", ")", "{", "throw", "new", "IOException", "(", "GT", ".", "tr"...
helper for decode
[ "helper", "for", "decode" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/UTF8Encoding.java#L25-L31
60,247
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
PgDatabaseMetaData.getMaxIndexKeys
protected int getMaxIndexKeys() throws SQLException { if (indexMaxKeys == 0) { String sql; sql = "SELECT setting FROM pg_catalog.pg_settings WHERE name='max_index_keys'"; Statement stmt = connection.createStatement(); ResultSet rs = null; try { rs = stmt.executeQuery(sql); ...
java
protected int getMaxIndexKeys() throws SQLException { if (indexMaxKeys == 0) { String sql; sql = "SELECT setting FROM pg_catalog.pg_settings WHERE name='max_index_keys'"; Statement stmt = connection.createStatement(); ResultSet rs = null; try { rs = stmt.executeQuery(sql); ...
[ "protected", "int", "getMaxIndexKeys", "(", ")", "throws", "SQLException", "{", "if", "(", "indexMaxKeys", "==", "0", ")", "{", "String", "sql", ";", "sql", "=", "\"SELECT setting FROM pg_catalog.pg_settings WHERE name='max_index_keys'\"", ";", "Statement", "stmt", "=...
maximum number of keys in an index.
[ "maximum", "number", "of", "keys", "in", "an", "index", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L46-L69
60,248
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
PgDatabaseMetaData.escapeQuotes
protected String escapeQuotes(String s) throws SQLException { StringBuilder sb = new StringBuilder(); if (!connection.getStandardConformingStrings()) { sb.append("E"); } sb.append("'"); sb.append(connection.escapeString(s)); sb.append("'"); return sb.toString(); }
java
protected String escapeQuotes(String s) throws SQLException { StringBuilder sb = new StringBuilder(); if (!connection.getStandardConformingStrings()) { sb.append("E"); } sb.append("'"); sb.append(connection.escapeString(s)); sb.append("'"); return sb.toString(); }
[ "protected", "String", "escapeQuotes", "(", "String", "s", ")", "throws", "SQLException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "!", "connection", ".", "getStandardConformingStrings", "(", ")", ")", "{", "sb", "."...
Turn the provided value into a valid string literal for direct inclusion into a query. This includes the single quotes needed around it. @param s input value @return string literal for direct inclusion into a query @throws SQLException if something wrong happens
[ "Turn", "the", "provided", "value", "into", "a", "valid", "string", "literal", "for", "direct", "inclusion", "into", "a", "query", ".", "This", "includes", "the", "single", "quotes", "needed", "around", "it", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L1011-L1020
60,249
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
PgDatabaseMetaData.parseACLArray
private static List<String> parseACLArray(String aclString) { List<String> acls = new ArrayList<String>(); if (aclString == null || aclString.isEmpty()) { return acls; } boolean inQuotes = false; // start at 1 because of leading "{" int beginIndex = 1; char prevChar = ' '; for (int...
java
private static List<String> parseACLArray(String aclString) { List<String> acls = new ArrayList<String>(); if (aclString == null || aclString.isEmpty()) { return acls; } boolean inQuotes = false; // start at 1 because of leading "{" int beginIndex = 1; char prevChar = ' '; for (int...
[ "private", "static", "List", "<", "String", ">", "parseACLArray", "(", "String", "aclString", ")", "{", "List", "<", "String", ">", "acls", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "aclString", "==", "null", "||", "aclStri...
Parse an String of ACLs into a List of ACLs.
[ "Parse", "an", "String", "of", "ACLs", "into", "a", "List", "of", "ACLs", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L1793-L1825
60,250
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ObjectFactory.java
ObjectFactory.instantiate
public static Object instantiate(String classname, Properties info, boolean tryString, String stringarg) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Object[] a...
java
public static Object instantiate(String classname, Properties info, boolean tryString, String stringarg) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Object[] a...
[ "public", "static", "Object", "instantiate", "(", "String", "classname", ",", "Properties", "info", ",", "boolean", "tryString", ",", "String", "stringarg", ")", "throws", "ClassNotFoundException", ",", "SecurityException", ",", "NoSuchMethodException", ",", "IllegalA...
Instantiates a class using the appropriate constructor. If a constructor with a single Propertiesparameter exists, it is used. Otherwise, if tryString is true a constructor with a single String argument is searched if it fails, or tryString is true a no argument constructor is tried. @param classname name of the class...
[ "Instantiates", "a", "class", "using", "the", "appropriate", "constructor", ".", "If", "a", "constructor", "with", "a", "single", "Propertiesparameter", "exists", "it", "is", "used", ".", "Otherwise", "if", "tryString", "is", "true", "a", "constructor", "with", ...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ObjectFactory.java#L37-L61
60,251
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
PgResultSet.isUpdateable
boolean isUpdateable() throws SQLException { checkClosed(); if (resultsetconcurrency == ResultSet.CONCUR_READ_ONLY) { throw new PSQLException( GT.tr("ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."), PSQLState.INVALID_CURSOR_STATE); } if (updateable) { ...
java
boolean isUpdateable() throws SQLException { checkClosed(); if (resultsetconcurrency == ResultSet.CONCUR_READ_ONLY) { throw new PSQLException( GT.tr("ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."), PSQLState.INVALID_CURSOR_STATE); } if (updateable) { ...
[ "boolean", "isUpdateable", "(", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "if", "(", "resultsetconcurrency", "==", "ResultSet", ".", "CONCUR_READ_ONLY", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"ResultSets...
Is this ResultSet updateable?
[ "Is", "this", "ResultSet", "updateable?" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java#L1471-L1553
60,252
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
PgResultSet.readDoubleValue
private double readDoubleValue(byte[] bytes, int oid, String targetType) throws PSQLException { // currently implemented binary encoded fields switch (oid) { case Oid.INT2: return ByteConverter.int2(bytes, 0); case Oid.INT4: return ByteConverter.int4(bytes, 0); case Oid.INT8: ...
java
private double readDoubleValue(byte[] bytes, int oid, String targetType) throws PSQLException { // currently implemented binary encoded fields switch (oid) { case Oid.INT2: return ByteConverter.int2(bytes, 0); case Oid.INT4: return ByteConverter.int4(bytes, 0); case Oid.INT8: ...
[ "private", "double", "readDoubleValue", "(", "byte", "[", "]", "bytes", ",", "int", "oid", ",", "String", "targetType", ")", "throws", "PSQLException", "{", "// currently implemented binary encoded fields", "switch", "(", "oid", ")", "{", "case", "Oid", ".", "IN...
Converts any numeric binary field to double value. This method does no overflow checking. @param bytes The bytes of the numeric field. @param oid The oid of the field. @param targetType The target type. Used for error reporting. @return The value as double. @throws PSQLException If the field type is not supported nume...
[ "Converts", "any", "numeric", "binary", "field", "to", "double", "value", ".", "This", "method", "does", "no", "overflow", "checking", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java#L2952-L2969
60,253
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java
ConnectionFactoryImpl.createPostgresTimeZone
private static String createPostgresTimeZone() { String tz = TimeZone.getDefault().getID(); if (tz.length() <= 3 || !tz.startsWith("GMT")) { return tz; } char sign = tz.charAt(3); String start; switch (sign) { case '+': start = "GMT-"; break; case '-': s...
java
private static String createPostgresTimeZone() { String tz = TimeZone.getDefault().getID(); if (tz.length() <= 3 || !tz.startsWith("GMT")) { return tz; } char sign = tz.charAt(3); String start; switch (sign) { case '+': start = "GMT-"; break; case '-': s...
[ "private", "static", "String", "createPostgresTimeZone", "(", ")", "{", "String", "tz", "=", "TimeZone", ".", "getDefault", "(", ")", ".", "getID", "(", ")", ";", "if", "(", "tz", ".", "length", "(", ")", "<=", "3", "||", "!", "tz", ".", "startsWith"...
Convert Java time zone to postgres time zone. All others stay the same except that GMT+nn changes to GMT-nn and vise versa. @return The current JVM time zone in postgresql format.
[ "Convert", "Java", "time", "zone", "to", "postgres", "time", "zone", ".", "All", "others", "stay", "the", "same", "except", "that", "GMT", "+", "nn", "changes", "to", "GMT", "-", "nn", "and", "vise", "versa", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java#L369-L389
60,254
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java
LargeObject.close
public void close() throws SQLException { if (!closed) { // flush any open output streams if (os != null) { try { // we can't call os.close() otherwise we go into an infinite loop! os.flush(); } catch (IOException ioe) { throw new PSQLException("Exception fl...
java
public void close() throws SQLException { if (!closed) { // flush any open output streams if (os != null) { try { // we can't call os.close() otherwise we go into an infinite loop! os.flush(); } catch (IOException ioe) { throw new PSQLException("Exception fl...
[ "public", "void", "close", "(", ")", "throws", "SQLException", "{", "if", "(", "!", "closed", ")", "{", "// flush any open output streams", "if", "(", "os", "!=", "null", ")", "{", "try", "{", "// we can't call os.close() otherwise we go into an infinite loop!", "os...
This method closes the object. You must not call methods in this object after this is called. @throws SQLException if a database-access error occurs.
[ "This", "method", "closes", "the", "object", ".", "You", "must", "not", "call", "methods", "in", "this", "object", "after", "this", "is", "called", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java#L156-L179
60,255
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java
LargeObject.read
public int read(byte[] buf, int off, int len) throws SQLException { byte[] b = read(len); if (b.length < len) { len = b.length; } System.arraycopy(b, 0, buf, off, len); return len; }
java
public int read(byte[] buf, int off, int len) throws SQLException { byte[] b = read(len); if (b.length < len) { len = b.length; } System.arraycopy(b, 0, buf, off, len); return len; }
[ "public", "int", "read", "(", "byte", "[", "]", "buf", ",", "int", "off", ",", "int", "len", ")", "throws", "SQLException", "{", "byte", "[", "]", "b", "=", "read", "(", "len", ")", ";", "if", "(", "b", ".", "length", "<", "len", ")", "{", "l...
Reads some data from the object into an existing array. @param buf destination array @param off offset within array @param len number of bytes to read @return the number of bytes actually read @throws SQLException if a database-access error occurs.
[ "Reads", "some", "data", "from", "the", "object", "into", "an", "existing", "array", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java#L206-L213
60,256
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java
LargeObject.write
public void write(byte[] buf, int off, int len) throws SQLException { FastpathArg[] args = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(buf, off, len); fp.fastpath("lowrite", args); }
java
public void write(byte[] buf, int off, int len) throws SQLException { FastpathArg[] args = new FastpathArg[2]; args[0] = new FastpathArg(fd); args[1] = new FastpathArg(buf, off, len); fp.fastpath("lowrite", args); }
[ "public", "void", "write", "(", "byte", "[", "]", "buf", ",", "int", "off", ",", "int", "len", ")", "throws", "SQLException", "{", "FastpathArg", "[", "]", "args", "=", "new", "FastpathArg", "[", "2", "]", ";", "args", "[", "0", "]", "=", "new", ...
Writes some data from an array to the object. @param buf destination array @param off offset within array @param len number of bytes to write @throws SQLException if a database-access error occurs.
[ "Writes", "some", "data", "from", "an", "array", "to", "the", "object", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java#L236-L241
60,257
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/v3/BatchedQuery.java
BatchedQuery.getNativeSql
@Override public String getNativeSql() { if (sql != null) { return sql; } sql = buildNativeSql(null); return sql; }
java
@Override public String getNativeSql() { if (sql != null) { return sql; } sql = buildNativeSql(null); return sql; }
[ "@", "Override", "public", "String", "getNativeSql", "(", ")", "{", "if", "(", "sql", "!=", "null", ")", "{", "return", "sql", ";", "}", "sql", "=", "buildNativeSql", "(", "null", ")", ";", "return", "sql", ";", "}" ]
Method to return the sql based on number of batches. Skipping the initial batch.
[ "Method", "to", "return", "the", "sql", "based", "on", "number", "of", "batches", ".", "Skipping", "the", "initial", "batch", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/BatchedQuery.java#L78-L85
60,258
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java
PgCallableStatement.checkIndex
protected void checkIndex(int parameterIndex, int type1, int type2, String getName) throws SQLException { checkIndex(parameterIndex); if (type1 != this.testReturn[parameterIndex - 1] && type2 != this.testReturn[parameterIndex - 1]) { throw new PSQLException( GT.tr("Parameter of typ...
java
protected void checkIndex(int parameterIndex, int type1, int type2, String getName) throws SQLException { checkIndex(parameterIndex); if (type1 != this.testReturn[parameterIndex - 1] && type2 != this.testReturn[parameterIndex - 1]) { throw new PSQLException( GT.tr("Parameter of typ...
[ "protected", "void", "checkIndex", "(", "int", "parameterIndex", ",", "int", "type1", ",", "int", "type2", ",", "String", "getName", ")", "throws", "SQLException", "{", "checkIndex", "(", "parameterIndex", ")", ";", "if", "(", "type1", "!=", "this", ".", "...
helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields against the return type. @param parameterIndex parameter index (1-based) @param type1 type 1 @param type2 type 2 @param getName getter name @throws SQLException if something goes wrong
[ "helperfunction", "for", "the", "getXXX", "calls", "to", "check", "isFunction", "and", "index", "==", "1", "Compare", "BOTH", "type", "fields", "against", "the", "return", "type", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java#L361-L372
60,259
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java
LargeObjectManager.open
public LargeObject open(int oid, int mode, boolean commitOnClose) throws SQLException { return open((long) oid, mode, commitOnClose); }
java
public LargeObject open(int oid, int mode, boolean commitOnClose) throws SQLException { return open((long) oid, mode, commitOnClose); }
[ "public", "LargeObject", "open", "(", "int", "oid", ",", "int", "mode", ",", "boolean", "commitOnClose", ")", "throws", "SQLException", "{", "return", "open", "(", "(", "long", ")", "oid", ",", "mode", ",", "commitOnClose", ")", ";", "}" ]
This opens an existing large object, same as previous method, but commits the transaction on close if asked. @param oid of large object @param mode mode of open @param commitOnClose commit the transaction when this LOB will be closed @return LargeObject instance providing access to the object @throws SQLException on e...
[ "This", "opens", "an", "existing", "large", "object", "same", "as", "previous", "method", "but", "commits", "the", "transaction", "on", "close", "if", "asked", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java#L227-L229
60,260
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java
LargeObjectManager.createLO
public long createLO(int mode) throws SQLException { if (conn.getAutoCommit()) { throw new PSQLException(GT.tr("Large Objects may not be used in auto-commit mode."), PSQLState.NO_ACTIVE_SQL_TRANSACTION); } FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(mode); retu...
java
public long createLO(int mode) throws SQLException { if (conn.getAutoCommit()) { throw new PSQLException(GT.tr("Large Objects may not be used in auto-commit mode."), PSQLState.NO_ACTIVE_SQL_TRANSACTION); } FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(mode); retu...
[ "public", "long", "createLO", "(", "int", "mode", ")", "throws", "SQLException", "{", "if", "(", "conn", ".", "getAutoCommit", "(", ")", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Large Objects may not be used in auto-commit mode.\"...
This creates a large object, returning its OID. @param mode a bitmask describing different attributes of the new object @return oid of new object @throws SQLException on error
[ "This", "creates", "a", "large", "object", "returning", "its", "OID", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java#L293-L301
60,261
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java
LargeObjectManager.delete
public void delete(long oid) throws SQLException { FastpathArg[] args = new FastpathArg[1]; args[0] = Fastpath.createOIDArg(oid); fp.fastpath("lo_unlink", args); }
java
public void delete(long oid) throws SQLException { FastpathArg[] args = new FastpathArg[1]; args[0] = Fastpath.createOIDArg(oid); fp.fastpath("lo_unlink", args); }
[ "public", "void", "delete", "(", "long", "oid", ")", "throws", "SQLException", "{", "FastpathArg", "[", "]", "args", "=", "new", "FastpathArg", "[", "1", "]", ";", "args", "[", "0", "]", "=", "Fastpath", ".", "createOIDArg", "(", "oid", ")", ";", "fp...
This deletes a large object. @param oid describing object to delete @throws SQLException on error
[ "This", "deletes", "a", "large", "object", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObjectManager.java#L323-L327
60,262
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java
VisibleBufferedInputStream.ensureBytes
public boolean ensureBytes(int n) throws IOException { int required = n - endIndex + index; while (required > 0) { if (!readMore(required)) { return false; } required = n - endIndex + index; } return true; }
java
public boolean ensureBytes(int n) throws IOException { int required = n - endIndex + index; while (required > 0) { if (!readMore(required)) { return false; } required = n - endIndex + index; } return true; }
[ "public", "boolean", "ensureBytes", "(", "int", "n", ")", "throws", "IOException", "{", "int", "required", "=", "n", "-", "endIndex", "+", "index", ";", "while", "(", "required", ">", "0", ")", "{", "if", "(", "!", "readMore", "(", "required", ")", "...
Ensures that the buffer contains at least n bytes. This method invalidates the buffer and index fields. @param n The amount of bytes to ensure exists in buffer @return true if required bytes are available and false if EOF @throws IOException If reading of the wrapped stream failed.
[ "Ensures", "that", "the", "buffer", "contains", "at", "least", "n", "bytes", ".", "This", "method", "invalidates", "the", "buffer", "and", "index", "fields", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java#L106-L115
60,263
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java
VisibleBufferedInputStream.readMore
private boolean readMore(int wanted) throws IOException { if (endIndex == index) { index = 0; endIndex = 0; } int canFit = buffer.length - endIndex; if (canFit < wanted) { // would the wanted bytes fit if we compacted the buffer // and still leave some slack if (index + can...
java
private boolean readMore(int wanted) throws IOException { if (endIndex == index) { index = 0; endIndex = 0; } int canFit = buffer.length - endIndex; if (canFit < wanted) { // would the wanted bytes fit if we compacted the buffer // and still leave some slack if (index + can...
[ "private", "boolean", "readMore", "(", "int", "wanted", ")", "throws", "IOException", "{", "if", "(", "endIndex", "==", "index", ")", "{", "index", "=", "0", ";", "endIndex", "=", "0", ";", "}", "int", "canFit", "=", "buffer", ".", "length", "-", "en...
Reads more bytes into the buffer. @param wanted How much should be at least read. @return True if at least some bytes were read. @throws IOException If reading of the wrapped stream failed.
[ "Reads", "more", "bytes", "into", "the", "buffer", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java#L124-L146
60,264
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java
VisibleBufferedInputStream.moveBufferTo
private void moveBufferTo(byte[] dest) { int size = endIndex - index; System.arraycopy(buffer, index, dest, 0, size); index = 0; endIndex = size; }
java
private void moveBufferTo(byte[] dest) { int size = endIndex - index; System.arraycopy(buffer, index, dest, 0, size); index = 0; endIndex = size; }
[ "private", "void", "moveBufferTo", "(", "byte", "[", "]", "dest", ")", "{", "int", "size", "=", "endIndex", "-", "index", ";", "System", ".", "arraycopy", "(", "buffer", ",", "index", ",", "dest", ",", "0", ",", "size", ")", ";", "index", "=", "0",...
Moves bytes from the buffer to the beginning of the destination buffer. Also sets the index and endIndex variables. @param dest The destination buffer.
[ "Moves", "bytes", "from", "the", "buffer", "to", "the", "beginning", "of", "the", "destination", "buffer", ".", "Also", "sets", "the", "index", "and", "endIndex", "variables", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/VisibleBufferedInputStream.java#L170-L175
60,265
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ExpressionProperties.java
ExpressionProperties.getRawPropertyValue
public String getRawPropertyValue(String key) { String value = super.getProperty(key); if (value != null) { return value; } for (Properties properties : defaults) { value = properties.getProperty(key); if (value != null) { return value; } } return null; }
java
public String getRawPropertyValue(String key) { String value = super.getProperty(key); if (value != null) { return value; } for (Properties properties : defaults) { value = properties.getProperty(key); if (value != null) { return value; } } return null; }
[ "public", "String", "getRawPropertyValue", "(", "String", "key", ")", "{", "String", "value", "=", "super", ".", "getProperty", "(", "key", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "return", "value", ";", "}", "for", "(", "Properties", "pr...
Returns raw value of a property without any replacements. @param key property name @return raw property value
[ "Returns", "raw", "value", "of", "a", "property", "without", "any", "replacements", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ExpressionProperties.java#L58-L70
60,266
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java
AbstractBlobClob.truncate
public synchronized void truncate(long len) throws SQLException { checkFreed(); if (!conn.haveMinimumServerVersion(ServerVersion.v8_3)) { throw new PSQLException( GT.tr("Truncation of large objects is only implemented in 8.3 and later servers."), PSQLState.NOT_IMPLEMENTED); } ...
java
public synchronized void truncate(long len) throws SQLException { checkFreed(); if (!conn.haveMinimumServerVersion(ServerVersion.v8_3)) { throw new PSQLException( GT.tr("Truncation of large objects is only implemented in 8.3 and later servers."), PSQLState.NOT_IMPLEMENTED); } ...
[ "public", "synchronized", "void", "truncate", "(", "long", "len", ")", "throws", "SQLException", "{", "checkFreed", "(", ")", ";", "if", "(", "!", "conn", ".", "haveMinimumServerVersion", "(", "ServerVersion", ".", "v8_3", ")", ")", "{", "throw", "new", "P...
For Blobs this should be in bytes while for Clobs it should be in characters. Since we really haven't figured out how to handle character sets for Clobs the current implementation uses bytes for both Blobs and Clobs. @param len maximum length @throws SQLException if operation fails
[ "For", "Blobs", "this", "should", "be", "in", "bytes", "while", "for", "Clobs", "it", "should", "be", "in", "characters", ".", "Since", "we", "really", "haven", "t", "figured", "out", "how", "to", "handle", "character", "sets", "for", "Clobs", "the", "cu...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java#L73-L95
60,267
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java
AbstractBlobClob.position
public synchronized long position(byte[] pattern, long start) throws SQLException { assertPosition(start, pattern.length); int position = 1; int patternIdx = 0; long result = -1; int tmpPosition = 1; for (LOIterator i = new LOIterator(start - 1); i.hasNext(); position++) { byte b = i.nex...
java
public synchronized long position(byte[] pattern, long start) throws SQLException { assertPosition(start, pattern.length); int position = 1; int patternIdx = 0; long result = -1; int tmpPosition = 1; for (LOIterator i = new LOIterator(start - 1); i.hasNext(); position++) { byte b = i.nex...
[ "public", "synchronized", "long", "position", "(", "byte", "[", "]", "pattern", ",", "long", "start", ")", "throws", "SQLException", "{", "assertPosition", "(", "start", ",", "pattern", ".", "length", ")", ";", "int", "position", "=", "1", ";", "int", "p...
Iterate over the buffer looking for the specified pattern. @param pattern A pattern of bytes to search the blob for @param start The position to start reading from @return position of the specified pattern @throws SQLException if something wrong happens
[ "Iterate", "over", "the", "buffer", "looking", "for", "the", "specified", "pattern", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java#L136-L161
60,268
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java
AbstractBlobClob.assertPosition
protected void assertPosition(long pos, long len) throws SQLException { checkFreed(); if (pos < 1) { throw new PSQLException(GT.tr("LOB positioning offsets start at 1."), PSQLState.INVALID_PARAMETER_VALUE); } if (pos + len - 1 > Integer.MAX_VALUE) { throw new PSQLException(GT.tr("P...
java
protected void assertPosition(long pos, long len) throws SQLException { checkFreed(); if (pos < 1) { throw new PSQLException(GT.tr("LOB positioning offsets start at 1."), PSQLState.INVALID_PARAMETER_VALUE); } if (pos + len - 1 > Integer.MAX_VALUE) { throw new PSQLException(GT.tr("P...
[ "protected", "void", "assertPosition", "(", "long", "pos", ",", "long", "len", ")", "throws", "SQLException", "{", "checkFreed", "(", ")", ";", "if", "(", "pos", "<", "1", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"LOB pos...
Throws an exception if the pos value exceeds the max value by which the large object API can index. @param pos Position to write at. @param len number of bytes to write. @throws SQLException if something goes wrong
[ "Throws", "an", "exception", "if", "the", "pos", "value", "exceeds", "the", "max", "value", "by", "which", "the", "large", "object", "API", "can", "index", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/AbstractBlobClob.java#L224-L234
60,269
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/sspi/NTDSAPIWrapper.java
NTDSAPIWrapper.DsMakeSpn
public String DsMakeSpn(String serviceClass, String serviceName, String instanceName, short instancePort, String referrer) throws LastErrorException { IntByReference spnLength = new IntByReference(2048); char[] spn = new char[spnLength.getValue()]; final int ret = NTDSAPI.instance.DsMakeSpnW(...
java
public String DsMakeSpn(String serviceClass, String serviceName, String instanceName, short instancePort, String referrer) throws LastErrorException { IntByReference spnLength = new IntByReference(2048); char[] spn = new char[spnLength.getValue()]; final int ret = NTDSAPI.instance.DsMakeSpnW(...
[ "public", "String", "DsMakeSpn", "(", "String", "serviceClass", ",", "String", "serviceName", ",", "String", "instanceName", ",", "short", "instancePort", ",", "String", "referrer", ")", "throws", "LastErrorException", "{", "IntByReference", "spnLength", "=", "new",...
Convenience wrapper for NTDSAPI DsMakeSpn with Java friendly string and exception handling. @param serviceClass See MSDN @param serviceName See MSDN @param instanceName See MSDN @param instancePort See MSDN @param referrer See MSDN @return SPN generated @throws LastErrorException If buffer too small or parameter incor...
[ "Convenience", "wrapper", "for", "NTDSAPI", "DsMakeSpn", "with", "Java", "friendly", "string", "and", "exception", "handling", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/sspi/NTDSAPIWrapper.java#L30-L51
60,270
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java
ByteConverter.int8
public static long int8(byte[] bytes, int idx) { return ((long) (bytes[idx + 0] & 255) << 56) + ((long) (bytes[idx + 1] & 255) << 48) + ((long) (bytes[idx + 2] & 255) << 40) + ((long) (bytes[idx + 3] & 255) << 32) + ((long) (bytes[idx + 4] & 255) << 24) ...
java
public static long int8(byte[] bytes, int idx) { return ((long) (bytes[idx + 0] & 255) << 56) + ((long) (bytes[idx + 1] & 255) << 48) + ((long) (bytes[idx + 2] & 255) << 40) + ((long) (bytes[idx + 3] & 255) << 32) + ((long) (bytes[idx + 4] & 255) << 24) ...
[ "public", "static", "long", "int8", "(", "byte", "[", "]", "bytes", ",", "int", "idx", ")", "{", "return", "(", "(", "long", ")", "(", "bytes", "[", "idx", "+", "0", "]", "&", "255", ")", "<<", "56", ")", "+", "(", "(", "long", ")", "(", "b...
Parses a long value from the byte array. @param bytes The byte array to parse. @param idx The starting index of the parse in the byte array. @return parsed long value.
[ "Parses", "a", "long", "value", "from", "the", "byte", "array", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L26-L36
60,271
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java
ByteConverter.int4
public static int int4(byte[] bytes, int idx) { return ((bytes[idx] & 255) << 24) + ((bytes[idx + 1] & 255) << 16) + ((bytes[idx + 2] & 255) << 8) + ((bytes[idx + 3] & 255)); }
java
public static int int4(byte[] bytes, int idx) { return ((bytes[idx] & 255) << 24) + ((bytes[idx + 1] & 255) << 16) + ((bytes[idx + 2] & 255) << 8) + ((bytes[idx + 3] & 255)); }
[ "public", "static", "int", "int4", "(", "byte", "[", "]", "bytes", ",", "int", "idx", ")", "{", "return", "(", "(", "bytes", "[", "idx", "]", "&", "255", ")", "<<", "24", ")", "+", "(", "(", "bytes", "[", "idx", "+", "1", "]", "&", "255", "...
Parses an int value from the byte array. @param bytes The byte array to parse. @param idx The starting index of the parse in the byte array. @return parsed int value.
[ "Parses", "an", "int", "value", "from", "the", "byte", "array", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L45-L51
60,272
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java
ByteConverter.int8
public static void int8(byte[] target, int idx, long value) { target[idx + 0] = (byte) (value >>> 56); target[idx + 1] = (byte) (value >>> 48); target[idx + 2] = (byte) (value >>> 40); target[idx + 3] = (byte) (value >>> 32); target[idx + 4] = (byte) (value >>> 24); target[idx + 5] = (byte) (val...
java
public static void int8(byte[] target, int idx, long value) { target[idx + 0] = (byte) (value >>> 56); target[idx + 1] = (byte) (value >>> 48); target[idx + 2] = (byte) (value >>> 40); target[idx + 3] = (byte) (value >>> 32); target[idx + 4] = (byte) (value >>> 24); target[idx + 5] = (byte) (val...
[ "public", "static", "void", "int8", "(", "byte", "[", "]", "target", ",", "int", "idx", ",", "long", "value", ")", "{", "target", "[", "idx", "+", "0", "]", "=", "(", "byte", ")", "(", "value", ">>>", "56", ")", ";", "target", "[", "idx", "+", ...
Encodes a long value to the byte array. @param target The byte array to encode to. @param idx The starting index in the byte array. @param value The value to encode.
[ "Encodes", "a", "long", "value", "to", "the", "byte", "array", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L106-L115
60,273
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Encoding.java
Encoding.getJVMEncoding
public static Encoding getJVMEncoding(String jvmEncoding) { if ("UTF-8".equals(jvmEncoding)) { return new UTF8Encoding(); } if (Charset.isSupported(jvmEncoding)) { return new Encoding(jvmEncoding); } else { return DEFAULT_ENCODING; } }
java
public static Encoding getJVMEncoding(String jvmEncoding) { if ("UTF-8".equals(jvmEncoding)) { return new UTF8Encoding(); } if (Charset.isSupported(jvmEncoding)) { return new Encoding(jvmEncoding); } else { return DEFAULT_ENCODING; } }
[ "public", "static", "Encoding", "getJVMEncoding", "(", "String", "jvmEncoding", ")", "{", "if", "(", "\"UTF-8\"", ".", "equals", "(", "jvmEncoding", ")", ")", "{", "return", "new", "UTF8Encoding", "(", ")", ";", "}", "if", "(", "Charset", ".", "isSupported...
Construct an Encoding for a given JVM encoding. @param jvmEncoding the name of the JVM encoding @return an Encoding instance for the specified encoding, or an Encoding instance for the default JVM encoding if the specified encoding is unavailable.
[ "Construct", "an", "Encoding", "for", "a", "given", "JVM", "encoding", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Encoding.java#L135-L144
60,274
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Encoding.java
Encoding.getDatabaseEncoding
public static Encoding getDatabaseEncoding(String databaseEncoding) { if ("UTF8".equals(databaseEncoding)) { return UTF8_ENCODING; } // If the backend encoding is known and there is a suitable // encoding in the JVM we use that. Otherwise we fall back // to the default encoding of the JVM. ...
java
public static Encoding getDatabaseEncoding(String databaseEncoding) { if ("UTF8".equals(databaseEncoding)) { return UTF8_ENCODING; } // If the backend encoding is known and there is a suitable // encoding in the JVM we use that. Otherwise we fall back // to the default encoding of the JVM. ...
[ "public", "static", "Encoding", "getDatabaseEncoding", "(", "String", "databaseEncoding", ")", "{", "if", "(", "\"UTF8\"", ".", "equals", "(", "databaseEncoding", ")", ")", "{", "return", "UTF8_ENCODING", ";", "}", "// If the backend encoding is known and there is a sui...
Construct an Encoding for a given database encoding. @param databaseEncoding the name of the database encoding @return an Encoding instance for the specified encoding, or an Encoding instance for the default JVM encoding if the specified encoding is unavailable.
[ "Construct", "an", "Encoding", "for", "a", "given", "database", "encoding", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Encoding.java#L153-L179
60,275
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Encoding.java
Encoding.encode
public byte[] encode(String s) throws IOException { if (s == null) { return null; } return s.getBytes(encoding); }
java
public byte[] encode(String s) throws IOException { if (s == null) { return null; } return s.getBytes(encoding); }
[ "public", "byte", "[", "]", "encode", "(", "String", "s", ")", "throws", "IOException", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "return", "s", ".", "getBytes", "(", "encoding", ")", ";", "}" ]
Encode a string to an array of bytes. @param s the string to encode @return a bytearray containing the encoded string @throws IOException if something goes wrong
[ "Encode", "a", "string", "to", "an", "array", "of", "bytes", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Encoding.java#L197-L203
60,276
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Encoding.java
Encoding.decode
public String decode(byte[] encodedString, int offset, int length) throws IOException { return new String(encodedString, offset, length, encoding); }
java
public String decode(byte[] encodedString, int offset, int length) throws IOException { return new String(encodedString, offset, length, encoding); }
[ "public", "String", "decode", "(", "byte", "[", "]", "encodedString", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "return", "new", "String", "(", "encodedString", ",", "offset", ",", "length", ",", "encoding", ")", ";", ...
Decode an array of bytes into a string. @param encodedString a byte array containing the string to decode @param offset the offset in <code>encodedString</code> of the first byte of the encoded representation @param length the length, in bytes, of the encoded representation @return the decoded string @th...
[ "Decode", "an", "array", "of", "bytes", "into", "a", "string", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Encoding.java#L215-L217
60,277
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.getFunction
public static Method getFunction(String functionName) { return functionMap.get("sql" + functionName.toLowerCase(Locale.US)); }
java
public static Method getFunction(String functionName) { return functionMap.get("sql" + functionName.toLowerCase(Locale.US)); }
[ "public", "static", "Method", "getFunction", "(", "String", "functionName", ")", "{", "return", "functionMap", ".", "get", "(", "\"sql\"", "+", "functionName", ".", "toLowerCase", "(", "Locale", ".", "US", ")", ")", ";", "}" ]
get Method object implementing the given function. @param functionName name of the searched function @return a Method object or null if not found
[ "get", "Method", "object", "implementing", "the", "given", "function", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L137-L139
60,278
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqlconcat
public static String sqlconcat(List<?> parsedArgs) { StringBuilder buf = new StringBuilder(); buf.append('('); for (int iArg = 0; iArg < parsedArgs.size(); iArg++) { buf.append(parsedArgs.get(iArg)); if (iArg != (parsedArgs.size() - 1)) { buf.append(" || "); } } return buf....
java
public static String sqlconcat(List<?> parsedArgs) { StringBuilder buf = new StringBuilder(); buf.append('('); for (int iArg = 0; iArg < parsedArgs.size(); iArg++) { buf.append(parsedArgs.get(iArg)); if (iArg != (parsedArgs.size() - 1)) { buf.append(" || "); } } return buf....
[ "public", "static", "String", "sqlconcat", "(", "List", "<", "?", ">", "parsedArgs", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "iArg", "=", "0", "...
concat translation. @param parsedArgs arguments @return sql call
[ "concat", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L217-L227
60,279
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqlinsert
public static String sqlinsert(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 4) { throw new PSQLException(GT.tr("{0} function takes four and only four argument.", "insert"), PSQLState.SYNTAX_ERROR); } StringBuilder buf = new StringBuilder(); buf.append("overlay("); ...
java
public static String sqlinsert(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 4) { throw new PSQLException(GT.tr("{0} function takes four and only four argument.", "insert"), PSQLState.SYNTAX_ERROR); } StringBuilder buf = new StringBuilder(); buf.append("overlay("); ...
[ "public", "static", "String", "sqlinsert", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "!=", "4", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", ...
insert to overlay translation. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "insert", "to", "overlay", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L236-L246
60,280
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqllocate
public static String sqllocate(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() == 2) { return "position(" + parsedArgs.get(0) + " in " + parsedArgs.get(1) + ")"; } else if (parsedArgs.size() == 3) { String tmp = "position(" + parsedArgs.get(0) + " in substring(" + parsedArgs.get(1) +...
java
public static String sqllocate(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() == 2) { return "position(" + parsedArgs.get(0) + " in " + parsedArgs.get(1) + ")"; } else if (parsedArgs.size() == 3) { String tmp = "position(" + parsedArgs.get(0) + " in substring(" + parsedArgs.get(1) +...
[ "public", "static", "String", "sqllocate", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "==", "2", ")", "{", "return", "\"position(\"", "+", "parsedArgs", ".", "get", "(", ...
locate translation. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "locate", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L302-L313
60,281
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqlsubstring
public static String sqlsubstring(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() == 2) { return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + ")"; } else if (parsedArgs.size() == 3) { return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + "," + parsedArgs.get(2...
java
public static String sqlsubstring(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() == 2) { return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + ")"; } else if (parsedArgs.size() == 3) { return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + "," + parsedArgs.get(2...
[ "public", "static", "String", "sqlsubstring", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "==", "2", ")", "{", "return", "\"substr(\"", "+", "parsedArgs", ".", "get", "(", ...
substring to substr translation. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "substring", "to", "substr", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L377-L387
60,282
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqlcurdate
public static String sqlcurdate(List<?> parsedArgs) throws SQLException { if (!parsedArgs.isEmpty()) { throw new PSQLException(GT.tr("{0} function doesn''t take any argument.", "curdate"), PSQLState.SYNTAX_ERROR); } return "current_date"; }
java
public static String sqlcurdate(List<?> parsedArgs) throws SQLException { if (!parsedArgs.isEmpty()) { throw new PSQLException(GT.tr("{0} function doesn''t take any argument.", "curdate"), PSQLState.SYNTAX_ERROR); } return "current_date"; }
[ "public", "static", "String", "sqlcurdate", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "!", "parsedArgs", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"{...
curdate to current_date translation. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "curdate", "to", "current_date", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L407-L413
60,283
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqlmonthname
public static String sqlmonthname(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 1) { throw new PSQLException(GT.tr("{0} function takes one and only one argument.", "monthname"), PSQLState.SYNTAX_ERROR); } return "to_char(" + parsedArgs.get(0) + ",'Month')"; }
java
public static String sqlmonthname(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 1) { throw new PSQLException(GT.tr("{0} function takes one and only one argument.", "monthname"), PSQLState.SYNTAX_ERROR); } return "to_char(" + parsedArgs.get(0) + ",'Month')"; }
[ "public", "static", "String", "sqlmonthname", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "!=", "1", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(",...
monthname translation. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "monthname", "translation", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L522-L528
60,284
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java
EscapedFunctions.sqltimestampadd
public static String sqltimestampadd(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampadd"), PSQLState.SYNTAX_ERROR); } String interval = EscapedFunctions.constantT...
java
public static String sqltimestampadd(List<?> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampadd"), PSQLState.SYNTAX_ERROR); } String interval = EscapedFunctions.constantT...
[ "public", "static", "String", "sqltimestampadd", "(", "List", "<", "?", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "!=", "3", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "...
time stamp add. @param parsedArgs arguments @return sql call @throws SQLException if something wrong happens
[ "time", "stamp", "add", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L581-L593
60,285
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.getFunction
public static Method getFunction(String functionName) { Method method = FUNCTION_MAP.get(functionName); if (method != null) { return method; } String nameLower = functionName.toLowerCase(Locale.US); if (nameLower == functionName) { // Input name was in lower case, the function is not the...
java
public static Method getFunction(String functionName) { Method method = FUNCTION_MAP.get(functionName); if (method != null) { return method; } String nameLower = functionName.toLowerCase(Locale.US); if (nameLower == functionName) { // Input name was in lower case, the function is not the...
[ "public", "static", "Method", "getFunction", "(", "String", "functionName", ")", "{", "Method", "method", "=", "FUNCTION_MAP", ".", "get", "(", "functionName", ")", ";", "if", "(", "method", "!=", "null", ")", "{", "return", "method", ";", "}", "String", ...
get Method object implementing the given function @param functionName name of the searched function @return a Method object or null if not found
[ "get", "Method", "object", "implementing", "the", "given", "function" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L58-L76
60,286
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlceiling
public static void sqlceiling(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "ceil(", "ceiling", parsedArgs); }
java
public static void sqlceiling(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "ceil(", "ceiling", parsedArgs); }
[ "public", "static", "void", "sqlceiling", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"ceil(\"", ",", "\"ceiling\"", ",", "...
ceiling to ceil translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "ceiling", "to", "ceil", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L87-L89
60,287
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqllog
public static void sqllog(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "ln(", "log", parsedArgs); }
java
public static void sqllog(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "ln(", "log", parsedArgs); }
[ "public", "static", "void", "sqllog", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"ln(\"", ",", "\"log\"", ",", "parsedArgs...
log to ln translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "log", "to", "ln", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L98-L100
60,288
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqllog10
public static void sqllog10(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "log(", "log10", parsedArgs); }
java
public static void sqllog10(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "log(", "log10", parsedArgs); }
[ "public", "static", "void", "sqllog10", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"log(\"", ",", "\"log10\"", ",", "parse...
log10 to log translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "log10", "to", "log", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L109-L111
60,289
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlpower
public static void sqlpower(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { twoArgumentsFunctionCall(buf, "pow(", "power", parsedArgs); }
java
public static void sqlpower(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { twoArgumentsFunctionCall(buf, "pow(", "power", parsedArgs); }
[ "public", "static", "void", "sqlpower", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "twoArgumentsFunctionCall", "(", "buf", ",", "\"pow(\"", ",", "\"power\"", ",", "parsedA...
power to pow translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "power", "to", "pow", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L120-L122
60,290
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqltruncate
public static void sqltruncate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { twoArgumentsFunctionCall(buf, "trunc(", "truncate", parsedArgs); }
java
public static void sqltruncate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { twoArgumentsFunctionCall(buf, "trunc(", "truncate", parsedArgs); }
[ "public", "static", "void", "sqltruncate", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "twoArgumentsFunctionCall", "(", "buf", ",", "\"trunc(\"", ",", "\"truncate\"", ",", ...
truncate to trunc translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "truncate", "to", "trunc", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L131-L133
60,291
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlchar
public static void sqlchar(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "chr(", "char", parsedArgs); }
java
public static void sqlchar(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "chr(", "char", parsedArgs); }
[ "public", "static", "void", "sqlchar", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"chr(\"", ",", "\"char\"", ",", "parsedA...
char to chr translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "char", "to", "chr", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L144-L146
60,292
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqllcase
public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs); }
java
public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs); }
[ "public", "static", "void", "sqllcase", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"lower(\"", ",", "\"lcase\"", ",", "par...
lcase to lower translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "lcase", "to", "lower", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L183-L185
60,293
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlucase
public static void sqlucase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "upper(", "ucase", parsedArgs); }
java
public static void sqlucase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "upper(", "ucase", parsedArgs); }
[ "public", "static", "void", "sqlucase", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"upper(\"", ",", "\"ucase\"", ",", "par...
ucase to upper translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "ucase", "to", "upper", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L320-L322
60,294
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlcurdate
public static void sqlcurdate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_date", "curdate", parsedArgs); }
java
public static void sqlcurdate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_date", "curdate", parsedArgs); }
[ "public", "static", "void", "sqlcurdate", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "zeroArgumentFunctionCall", "(", "buf", ",", "\"current_date\"", ",", "\"curdate\"", ","...
curdate to current_date translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "curdate", "to", "current_date", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L331-L333
60,295
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqlcurtime
public static void sqlcurtime(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_time", "curtime", parsedArgs); }
java
public static void sqlcurtime(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { zeroArgumentFunctionCall(buf, "current_time", "curtime", parsedArgs); }
[ "public", "static", "void", "sqlcurtime", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "zeroArgumentFunctionCall", "(", "buf", ",", "\"current_time\"", ",", "\"curtime\"", ","...
curtime to current_time translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "curtime", "to", "current_time", "translation" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L342-L344
60,296
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqltimestampadd
public static void sqltimestampadd(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampadd"), PSQLState.SYNTAX_ERROR); } buf.ap...
java
public static void sqltimestampadd(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampadd"), PSQLState.SYNTAX_ERROR); } buf.ap...
[ "public", "static", "void", "sqltimestampadd", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "!=", "3", ")", "{", "throw...
time stamp add @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "time", "stamp", "add" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L497-L506
60,297
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.areSameTsi
private static boolean areSameTsi(String a, String b) { return a.length() == b.length() && b.length() > SQL_TSI_ROOT.length() && a.regionMatches(true, SQL_TSI_ROOT.length(), b, SQL_TSI_ROOT.length(), b.length() - SQL_TSI_ROOT.length()); }
java
private static boolean areSameTsi(String a, String b) { return a.length() == b.length() && b.length() > SQL_TSI_ROOT.length() && a.regionMatches(true, SQL_TSI_ROOT.length(), b, SQL_TSI_ROOT.length(), b.length() - SQL_TSI_ROOT.length()); }
[ "private", "static", "boolean", "areSameTsi", "(", "String", "a", ",", "String", "b", ")", "{", "return", "a", ".", "length", "(", ")", "==", "b", ".", "length", "(", ")", "&&", "b", ".", "length", "(", ")", ">", "SQL_TSI_ROOT", ".", "length", "(",...
Compares two TSI intervals. It is @param a first interval to compare @param b second interval to compare @return true when both intervals are equal (case insensitive)
[ "Compares", "two", "TSI", "intervals", ".", "It", "is" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L546-L549
60,298
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqltimestampdiff
public static void sqltimestampdiff(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampdiff"), PSQLState.SYNTAX_ERROR); } buf....
java
public static void sqltimestampdiff(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { if (parsedArgs.size() != 3) { throw new PSQLException( GT.tr("{0} function takes three and only three arguments.", "timestampdiff"), PSQLState.SYNTAX_ERROR); } buf....
[ "public", "static", "void", "sqltimestampdiff", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "if", "(", "parsedArgs", ".", "size", "(", ")", "!=", "3", ")", "{", "thro...
time stamp diff @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "time", "stamp", "diff" ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L567-L580
60,299
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java
PgPreparedStatement.setPGobject
private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) { throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE);...
java
private void setPGobject(int parameterIndex, PGobject x) throws SQLException { String typename = x.getType(); int oid = connection.getTypeInfo().getPGType(typename); if (oid == Oid.UNSPECIFIED) { throw new PSQLException(GT.tr("Unknown type {0}.", typename), PSQLState.INVALID_PARAMETER_TYPE);...
[ "private", "void", "setPGobject", "(", "int", "parameterIndex", ",", "PGobject", "x", ")", "throws", "SQLException", "{", "String", "typename", "=", "x", ".", "getType", "(", ")", ";", "int", "oid", "=", "connection", ".", "getTypeInfo", "(", ")", ".", "...
Helper method for setting parameters to PGobject subclasses.
[ "Helper", "method", "for", "setting", "parameters", "to", "PGobject", "subclasses", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java#L444-L460