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
52,600
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalByte
public byte getInternalByte(ColumnInformation columnInfo) throws SQLException { if (lastValueWasNull()) { return 0; } long value = getInternalLong(columnInfo); rangeCheck(Byte.class, Byte.MIN_VALUE, Byte.MAX_VALUE, value, columnInfo); return (byte) value; }
java
public byte getInternalByte(ColumnInformation columnInfo) throws SQLException { if (lastValueWasNull()) { return 0; } long value = getInternalLong(columnInfo); rangeCheck(Byte.class, Byte.MIN_VALUE, Byte.MAX_VALUE, value, columnInfo); return (byte) value; }
[ "public", "byte", "getInternalByte", "(", "ColumnInformation", "columnInfo", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "0", ";", "}", "long", "value", "=", "getInternalLong", "(", "columnInfo", ")", ";", ...
Get byte from raw text format. @param columnInfo column information @return byte value @throws SQLException if column type doesn't permit conversion
[ "Get", "byte", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L816-L823
52,601
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalShort
public short getInternalShort(ColumnInformation columnInfo) throws SQLException { if (lastValueWasNull()) { return 0; } long value = getInternalLong(columnInfo); rangeCheck(Short.class, Short.MIN_VALUE, Short.MAX_VALUE, value, columnInfo); return (short) value; }
java
public short getInternalShort(ColumnInformation columnInfo) throws SQLException { if (lastValueWasNull()) { return 0; } long value = getInternalLong(columnInfo); rangeCheck(Short.class, Short.MIN_VALUE, Short.MAX_VALUE, value, columnInfo); return (short) value; }
[ "public", "short", "getInternalShort", "(", "ColumnInformation", "columnInfo", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "0", ";", "}", "long", "value", "=", "getInternalLong", "(", "columnInfo", ")", ";",...
Get short from raw text format. @param columnInfo column information @return short value @throws SQLException if column type doesn't permit conversion or value is not in Short range
[ "Get", "short", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L832-L839
52,602
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalTimeString
public String getInternalTimeString(ColumnInformation columnInfo) { if (lastValueWasNull()) { return null; } String rawValue = new String(buf, pos, length, StandardCharsets.UTF_8); if ("0000-00-00".equals(rawValue)) { return null; } if (options.maximizeMysqlCompatibility && options...
java
public String getInternalTimeString(ColumnInformation columnInfo) { if (lastValueWasNull()) { return null; } String rawValue = new String(buf, pos, length, StandardCharsets.UTF_8); if ("0000-00-00".equals(rawValue)) { return null; } if (options.maximizeMysqlCompatibility && options...
[ "public", "String", "getInternalTimeString", "(", "ColumnInformation", "columnInfo", ")", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", "String", "rawValue", "=", "new", "String", "(", "buf", ",", "pos", ",", "length", ...
Get Time in string format from raw text format. @param columnInfo column information @return String representation of time
[ "Get", "Time", "in", "string", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L847-L862
52,603
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalBigInteger
public BigInteger getInternalBigInteger(ColumnInformation columnInfo) { if (lastValueWasNull()) { return null; } return new BigInteger(new String(buf, pos, length, StandardCharsets.UTF_8)); }
java
public BigInteger getInternalBigInteger(ColumnInformation columnInfo) { if (lastValueWasNull()) { return null; } return new BigInteger(new String(buf, pos, length, StandardCharsets.UTF_8)); }
[ "public", "BigInteger", "getInternalBigInteger", "(", "ColumnInformation", "columnInfo", ")", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", "return", "new", "BigInteger", "(", "new", "String", "(", "buf", ",", "pos", ","...
Get BigInteger format from raw text format. @param columnInfo column information @return BigInteger value
[ "Get", "BigInteger", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L870-L875
52,604
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalZonedDateTime
public ZonedDateTime getInternalZonedDateTime(ColumnInformation columnInfo, Class clazz, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos...
java
public ZonedDateTime getInternalZonedDateTime(ColumnInformation columnInfo, Class clazz, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos...
[ "public", "ZonedDateTime", "getInternalZonedDateTime", "(", "ColumnInformation", "columnInfo", ",", "Class", "clazz", ",", "TimeZone", "timeZone", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", ...
Get ZonedDateTime format from raw text format. @param columnInfo column information @param clazz class for logging @param timeZone time zone @return ZonedDateTime value @throws SQLException if column type doesn't permit conversion
[ "Get", "ZonedDateTime", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L886-L935
52,605
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalOffsetTime
public OffsetTime getInternalOffsetTime(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } ZoneId zoneId = timeZone.toZoneId().normalized(); ...
java
public OffsetTime getInternalOffsetTime(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } ZoneId zoneId = timeZone.toZoneId().normalized(); ...
[ "public", "OffsetTime", "getInternalOffsetTime", "(", "ColumnInformation", "columnInfo", ",", "TimeZone", "timeZone", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "length", "==", ...
Get OffsetTime format from raw text format. @param columnInfo column information @param timeZone time zone @return OffsetTime value @throws SQLException if column type doesn't permit conversion
[ "Get", "OffsetTime", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L945-L1013
52,606
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalLocalTime
public LocalTime getInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos, length, StandardCha...
java
public LocalTime getInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos, length, StandardCha...
[ "public", "LocalTime", "getInternalLocalTime", "(", "ColumnInformation", "columnInfo", ",", "TimeZone", "timeZone", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "length", "==", "0...
Get LocalTime format from raw text format. @param columnInfo column information @param timeZone time zone @return LocalTime value @throws SQLException if column type doesn't permit conversion
[ "Get", "LocalTime", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L1023-L1061
52,607
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalLocalDate
public LocalDate getInternalLocalDate(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos, length, StandardCha...
java
public LocalDate getInternalLocalDate(ColumnInformation columnInfo, TimeZone timeZone) throws SQLException { if (lastValueWasNull()) { return null; } if (length == 0) { lastValueNull |= BIT_LAST_FIELD_NULL; return null; } String raw = new String(buf, pos, length, StandardCha...
[ "public", "LocalDate", "getInternalLocalDate", "(", "ColumnInformation", "columnInfo", ",", "TimeZone", "timeZone", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "length", "==", "0...
Get LocalDate format from raw text format. @param columnInfo column information @param timeZone time zone @return LocalDate value @throws SQLException if column type doesn't permit conversion
[ "Get", "LocalDate", "format", "from", "raw", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L1071-L1112
52,608
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
AbstractConnectProtocol.connect
public void connect() throws SQLException { if (!isClosed()) { close(); } try { connect((currentHost != null) ? currentHost.host : null, (currentHost != null) ? currentHost.port : 3306); } catch (IOException ioException) { throw ExceptionMapper.connException( "Coul...
java
public void connect() throws SQLException { if (!isClosed()) { close(); } try { connect((currentHost != null) ? currentHost.host : null, (currentHost != null) ? currentHost.port : 3306); } catch (IOException ioException) { throw ExceptionMapper.connException( "Coul...
[ "public", "void", "connect", "(", ")", "throws", "SQLException", "{", "if", "(", "!", "isClosed", "(", ")", ")", "{", "close", "(", ")", ";", "}", "try", "{", "connect", "(", "(", "currentHost", "!=", "null", ")", "?", "currentHost", ".", "host", "...
Connect to currentHost. @throws SQLException exception
[ "Connect", "to", "currentHost", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L363-L376
52,609
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
AbstractConnectProtocol.connect
private void connect(String host, int port) throws SQLException, IOException { try { socket = Utils.createSocket(urlParser, host); if (options.socketTimeout != null) { socket.setSoTimeout(options.socketTimeout); } initializeSocketOption(); // Bind the socket to a particular i...
java
private void connect(String host, int port) throws SQLException, IOException { try { socket = Utils.createSocket(urlParser, host); if (options.socketTimeout != null) { socket.setSoTimeout(options.socketTimeout); } initializeSocketOption(); // Bind the socket to a particular i...
[ "private", "void", "connect", "(", "String", "host", ",", "int", "port", ")", "throws", "SQLException", ",", "IOException", "{", "try", "{", "socket", "=", "Utils", ".", "createSocket", "(", "urlParser", ",", "host", ")", ";", "if", "(", "options", ".", ...
Connect the client and perform handshake. @param host host @param port port @throws SQLException handshake error, e.g wrong user or password @throws IOException connection error (host/port not available)
[ "Connect", "the", "client", "and", "perform", "handshake", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L386-L473
52,610
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
AbstractConnectProtocol.sendPipelineCheckMaster
private void sendPipelineCheckMaster() throws IOException { if (urlParser.getHaMode() == HaMode.AURORA) { writer.startPacket(0); writer.write(COM_QUERY); writer.write(IS_MASTER_QUERY); writer.flush(); } }
java
private void sendPipelineCheckMaster() throws IOException { if (urlParser.getHaMode() == HaMode.AURORA) { writer.startPacket(0); writer.write(COM_QUERY); writer.write(IS_MASTER_QUERY); writer.flush(); } }
[ "private", "void", "sendPipelineCheckMaster", "(", ")", "throws", "IOException", "{", "if", "(", "urlParser", ".", "getHaMode", "(", ")", "==", "HaMode", ".", "AURORA", ")", "{", "writer", ".", "startPacket", "(", "0", ")", ";", "writer", ".", "write", "...
Send query to identify if server is master. @throws IOException in case of socket error.
[ "Send", "query", "to", "identify", "if", "server", "is", "master", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L1068-L1075
52,611
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
AbstractConnectProtocol.enabledSslCipherSuites
private void enabledSslCipherSuites(SSLSocket sslSocket) throws SQLException { if (options.enabledSslCipherSuites != null) { List<String> possibleCiphers = Arrays.asList(sslSocket.getSupportedCipherSuites()); String[] ciphers = options.enabledSslCipherSuites.split("[,;\\s]+"); for (String cipher :...
java
private void enabledSslCipherSuites(SSLSocket sslSocket) throws SQLException { if (options.enabledSslCipherSuites != null) { List<String> possibleCiphers = Arrays.asList(sslSocket.getSupportedCipherSuites()); String[] ciphers = options.enabledSslCipherSuites.split("[,;\\s]+"); for (String cipher :...
[ "private", "void", "enabledSslCipherSuites", "(", "SSLSocket", "sslSocket", ")", "throws", "SQLException", "{", "if", "(", "options", ".", "enabledSslCipherSuites", "!=", "null", ")", "{", "List", "<", "String", ">", "possibleCiphers", "=", "Arrays", ".", "asLis...
Set ssl socket cipher according to options. @param sslSocket current ssl socket @throws SQLException if a cipher isn't known
[ "Set", "ssl", "socket", "cipher", "according", "to", "options", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L1265-L1277
52,612
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
AbstractConnectProtocol.versionGreaterOrEqual
public boolean versionGreaterOrEqual(int major, int minor, int patch) { if (this.majorVersion > major) { return true; } if (this.majorVersion < major) { return false; } /* * Major versions are equal, compare minor versions */ if (this.minorVersion > minor) { return ...
java
public boolean versionGreaterOrEqual(int major, int minor, int patch) { if (this.majorVersion > major) { return true; } if (this.majorVersion < major) { return false; } /* * Major versions are equal, compare minor versions */ if (this.minorVersion > minor) { return ...
[ "public", "boolean", "versionGreaterOrEqual", "(", "int", "major", ",", "int", "minor", ",", "int", "patch", ")", "{", "if", "(", "this", ".", "majorVersion", ">", "major", ")", "{", "return", "true", ";", "}", "if", "(", "this", ".", "majorVersion", "...
Utility method to check if database version is greater than parameters. @param major major version @param minor minor version @param patch patch version @return true if version is greater than parameters
[ "Utility", "method", "to", "check", "if", "database", "version", "is", "greater", "than", "parameters", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L1287-L1308
52,613
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ClearPasswordPlugin.java
ClearPasswordPlugin.process
public Buffer process(PacketOutputStream out, PacketInputStream in, AtomicInteger sequence) throws IOException { if (password == null || password.isEmpty()) { out.writeEmptyPacket(sequence.incrementAndGet()); } else { out.startPacket(sequence.incrementAndGet()); byte[] bytePwd; if (passw...
java
public Buffer process(PacketOutputStream out, PacketInputStream in, AtomicInteger sequence) throws IOException { if (password == null || password.isEmpty()) { out.writeEmptyPacket(sequence.incrementAndGet()); } else { out.startPacket(sequence.incrementAndGet()); byte[] bytePwd; if (passw...
[ "public", "Buffer", "process", "(", "PacketOutputStream", "out", ",", "PacketInputStream", "in", ",", "AtomicInteger", "sequence", ")", "throws", "IOException", "{", "if", "(", "password", "==", "null", "||", "password", ".", "isEmpty", "(", ")", ")", "{", "...
Send password in clear text to server. @param out out stream @param in in stream @param sequence packet sequence @return response packet @throws IOException if socket error
[ "Send", "password", "in", "clear", "text", "to", "server", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ClearPasswordPlugin.java#L87-L107
52,614
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/input/StandardPacketInputStream.java
StandardPacketInputStream.create
public static byte[] create(byte[][] rowDatas, ColumnType[] columnTypes) { int totalLength = 0; for (byte[] rowData : rowDatas) { if (rowData == null) { totalLength++; } else { int length = rowData.length; if (length < 251) { totalLength += length + 1; } el...
java
public static byte[] create(byte[][] rowDatas, ColumnType[] columnTypes) { int totalLength = 0; for (byte[] rowData : rowDatas) { if (rowData == null) { totalLength++; } else { int length = rowData.length; if (length < 251) { totalLength += length + 1; } el...
[ "public", "static", "byte", "[", "]", "create", "(", "byte", "[", "]", "[", "]", "rowDatas", ",", "ColumnType", "[", "]", "columnTypes", ")", "{", "int", "totalLength", "=", "0", ";", "for", "(", "byte", "[", "]", "rowData", ":", "rowDatas", ")", "...
Create Buffer with Text protocol values. @param rowDatas datas @param columnTypes column types @return Buffer
[ "Create", "Buffer", "with", "Text", "protocol", "values", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/input/StandardPacketInputStream.java#L159-L211
52,615
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/UrlParser.java
UrlParser.parse
public static UrlParser parse(final String url, Properties prop) throws SQLException { if (url != null && (url.startsWith("jdbc:mariadb:") || url.startsWith("jdbc:mysql:") && !url .contains(DISABLE_MYSQL_URL))) { UrlParser urlParser = new UrlParser(); parseInternal(urlParser, url, (prop ...
java
public static UrlParser parse(final String url, Properties prop) throws SQLException { if (url != null && (url.startsWith("jdbc:mariadb:") || url.startsWith("jdbc:mysql:") && !url .contains(DISABLE_MYSQL_URL))) { UrlParser urlParser = new UrlParser(); parseInternal(urlParser, url, (prop ...
[ "public", "static", "UrlParser", "parse", "(", "final", "String", "url", ",", "Properties", "prop", ")", "throws", "SQLException", "{", "if", "(", "url", "!=", "null", "&&", "(", "url", ".", "startsWith", "(", "\"jdbc:mariadb:\"", ")", "||", "url", ".", ...
Parse url connection string with additional properties. @param url connection string @param prop properties @return UrlParser instance @throws SQLException if parsing exception occur
[ "Parse", "url", "connection", "string", "with", "additional", "properties", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/UrlParser.java#L155-L164
52,616
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/UrlParser.java
UrlParser.parseInternal
private static void parseInternal(UrlParser urlParser, String url, Properties properties) throws SQLException { try { urlParser.initialUrl = url; int separator = url.indexOf("//"); if (separator == -1) { throw new IllegalArgumentException( "url parsing error : '//' is not...
java
private static void parseInternal(UrlParser urlParser, String url, Properties properties) throws SQLException { try { urlParser.initialUrl = url; int separator = url.indexOf("//"); if (separator == -1) { throw new IllegalArgumentException( "url parsing error : '//' is not...
[ "private", "static", "void", "parseInternal", "(", "UrlParser", "urlParser", ",", "String", "url", ",", "Properties", "properties", ")", "throws", "SQLException", "{", "try", "{", "urlParser", ".", "initialUrl", "=", "url", ";", "int", "separator", "=", "url",...
Parses the connection URL in order to set the UrlParser instance with all the information provided through the URL. @param urlParser object instance in which all data from the connection url is stored @param url connection URL @param properties properties @throws SQLException if format is incorrect
[ "Parses", "the", "connection", "URL", "in", "order", "to", "set", "the", "UrlParser", "instance", "with", "all", "the", "information", "provided", "through", "the", "URL", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/UrlParser.java#L175-L211
52,617
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/UrlParser.java
UrlParser.auroraPipelineQuirks
public UrlParser auroraPipelineQuirks() { //Aurora has issue with pipelining, depending on network speed. //Driver must rely on information provided by user : hostname if dns, and HA mode.</p> boolean disablePipeline = isAurora(); if (options.useBatchMultiSend == null) { options.useBatchMultiSen...
java
public UrlParser auroraPipelineQuirks() { //Aurora has issue with pipelining, depending on network speed. //Driver must rely on information provided by user : hostname if dns, and HA mode.</p> boolean disablePipeline = isAurora(); if (options.useBatchMultiSend == null) { options.useBatchMultiSen...
[ "public", "UrlParser", "auroraPipelineQuirks", "(", ")", "{", "//Aurora has issue with pipelining, depending on network speed.", "//Driver must rely on information provided by user : hostname if dns, and HA mode.</p>", "boolean", "disablePipeline", "=", "isAurora", "(", ")", ";", "if",...
Permit to set parameters not forced. if options useBatchMultiSend and usePipelineAuth are not explicitly set in connection string, value will default to true or false according if aurora detection. @return UrlParser for easy testing
[ "Permit", "to", "set", "parameters", "not", "forced", ".", "if", "options", "useBatchMultiSend", "and", "usePipelineAuth", "are", "not", "explicitly", "set", "in", "connection", "string", "value", "will", "default", "to", "true", "or", "false", "according", "if"...
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/UrlParser.java#L343-L357
52,618
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java
ServerPrepareStatementCache.removeEldestEntry
@Override public boolean removeEldestEntry(Map.Entry eldest) { boolean mustBeRemoved = this.size() > maxSize; if (mustBeRemoved) { ServerPrepareResult serverPrepareResult = ((ServerPrepareResult) eldest.getValue()); serverPrepareResult.setRemoveFromCache(); if (serverPrepareResult.canBeDeal...
java
@Override public boolean removeEldestEntry(Map.Entry eldest) { boolean mustBeRemoved = this.size() > maxSize; if (mustBeRemoved) { ServerPrepareResult serverPrepareResult = ((ServerPrepareResult) eldest.getValue()); serverPrepareResult.setRemoveFromCache(); if (serverPrepareResult.canBeDeal...
[ "@", "Override", "public", "boolean", "removeEldestEntry", "(", "Map", ".", "Entry", "eldest", ")", "{", "boolean", "mustBeRemoved", "=", "this", ".", "size", "(", ")", ">", "maxSize", ";", "if", "(", "mustBeRemoved", ")", "{", "ServerPrepareResult", "server...
Remove eldestEntry. @param eldest eldest entry @return true if eldest entry must be removed
[ "Remove", "eldestEntry", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java#L83-L99
52,619
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java
ServerPrepareStatementCache.put
public synchronized ServerPrepareResult put(String key, ServerPrepareResult result) { ServerPrepareResult cachedServerPrepareResult = super.get(key); //if there is already some cached data (and not been deallocate), return existing cached data if (cachedServerPrepareResult != null && cachedServerPrepareResu...
java
public synchronized ServerPrepareResult put(String key, ServerPrepareResult result) { ServerPrepareResult cachedServerPrepareResult = super.get(key); //if there is already some cached data (and not been deallocate), return existing cached data if (cachedServerPrepareResult != null && cachedServerPrepareResu...
[ "public", "synchronized", "ServerPrepareResult", "put", "(", "String", "key", ",", "ServerPrepareResult", "result", ")", "{", "ServerPrepareResult", "cachedServerPrepareResult", "=", "super", ".", "get", "(", "key", ")", ";", "//if there is already some cached data (and n...
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the existing cached prepared result shared counter will be incremented. @param key key @param result new prepare result. @return the previous value associated with key if not been deallocate, or...
[ "Associates", "the", "specified", "value", "with", "the", "specified", "key", "in", "this", "map", ".", "If", "the", "map", "previously", "contained", "a", "mapping", "for", "the", "key", "the", "existing", "cached", "prepared", "result", "shared", "counter", ...
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/ServerPrepareStatementCache.java#L111-L121
52,620
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/WindowsNativeSspiAuthentication.java
WindowsNativeSspiAuthentication.authenticate
public void authenticate(final PacketOutputStream out, final PacketInputStream in, final AtomicInteger sequence, final String servicePrincipalName, final String mechanisms) throws IOException { // initialize a security context on the client IWindowsSecurityContext clientContext = Win...
java
public void authenticate(final PacketOutputStream out, final PacketInputStream in, final AtomicInteger sequence, final String servicePrincipalName, final String mechanisms) throws IOException { // initialize a security context on the client IWindowsSecurityContext clientContext = Win...
[ "public", "void", "authenticate", "(", "final", "PacketOutputStream", "out", ",", "final", "PacketInputStream", "in", ",", "final", "AtomicInteger", "sequence", ",", "final", "String", "servicePrincipalName", ",", "final", "String", "mechanisms", ")", "throws", "IOE...
Process native windows GSS plugin authentication. @param out out stream @param in in stream @param sequence packet sequence @param servicePrincipalName principal name @param mechanisms gssapi mechanism @throws IOException if socket error
[ "Process", "native", "windows", "GSS", "plugin", "authentication", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/WindowsNativeSspiAuthentication.java#L78-L106
52,621
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/SendClosePacket.java
SendClosePacket.send
public static void send(final PacketOutputStream pos) { try { pos.startPacket(0); pos.write(Packet.COM_QUIT); pos.flush(); } catch (IOException ioe) { //eat } }
java
public static void send(final PacketOutputStream pos) { try { pos.startPacket(0); pos.write(Packet.COM_QUIT); pos.flush(); } catch (IOException ioe) { //eat } }
[ "public", "static", "void", "send", "(", "final", "PacketOutputStream", "pos", ")", "{", "try", "{", "pos", ".", "startPacket", "(", "0", ")", ";", "pos", ".", "write", "(", "Packet", ".", "COM_QUIT", ")", ";", "pos", ".", "flush", "(", ")", ";", "...
Send close stream to server. @param pos write outputStream
[ "Send", "close", "stream", "to", "server", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/SendClosePacket.java#L67-L75
52,622
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.flush
public void flush() throws IOException { flushBuffer(true); out.flush(); // if buffer is big, and last query doesn't use at least half of it, resize buffer to default value if (buf.length > SMALL_BUFFER_SIZE && cmdLength * 2 < buf.length) { buf = new byte[SMALL_BUFFER_SIZE]; } if (cmdLen...
java
public void flush() throws IOException { flushBuffer(true); out.flush(); // if buffer is big, and last query doesn't use at least half of it, resize buffer to default value if (buf.length > SMALL_BUFFER_SIZE && cmdLength * 2 < buf.length) { buf = new byte[SMALL_BUFFER_SIZE]; } if (cmdLen...
[ "public", "void", "flush", "(", ")", "throws", "IOException", "{", "flushBuffer", "(", "true", ")", ";", "out", ".", "flush", "(", ")", ";", "// if buffer is big, and last query doesn't use at least half of it, resize buffer to default value", "if", "(", "buf", ".", "...
Send packet to socket. @throws IOException if socket error occur.
[ "Send", "packet", "to", "socket", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L184-L198
52,623
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.checkMaxAllowedLength
public void checkMaxAllowedLength(int length) throws MaxAllowedPacketException { if (cmdLength + length >= maxAllowedPacket && cmdLength == 0) { //launch exception only if no packet has been send. throw new MaxAllowedPacketException("query size (" + (cmdLength + length) + ") is >= to max_allow...
java
public void checkMaxAllowedLength(int length) throws MaxAllowedPacketException { if (cmdLength + length >= maxAllowedPacket && cmdLength == 0) { //launch exception only if no packet has been send. throw new MaxAllowedPacketException("query size (" + (cmdLength + length) + ") is >= to max_allow...
[ "public", "void", "checkMaxAllowedLength", "(", "int", "length", ")", "throws", "MaxAllowedPacketException", "{", "if", "(", "cmdLength", "+", "length", ">=", "maxAllowedPacket", "&&", "cmdLength", "==", "0", ")", "{", "//launch exception only if no packet has been send...
Count query size. If query size is greater than max_allowed_packet and nothing has been already send, throw an exception to avoid having the connection closed. @param length additional length to query size @throws MaxAllowedPacketException if query has not to be send.
[ "Count", "query", "size", ".", "If", "query", "size", "is", "greater", "than", "max_allowed_packet", "and", "nothing", "has", "been", "already", "send", "throw", "an", "exception", "to", "avoid", "having", "the", "connection", "closed", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L211-L217
52,624
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.writeShort
public void writeShort(short value) throws IOException { if (2 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[2]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); write(arr, 0, 2); return; } buf[pos] = (byte) value; buf[pos + 1] = (byte)...
java
public void writeShort(short value) throws IOException { if (2 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[2]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); write(arr, 0, 2); return; } buf[pos] = (byte) value; buf[pos + 1] = (byte)...
[ "public", "void", "writeShort", "(", "short", "value", ")", "throws", "IOException", "{", "if", "(", "2", ">", "buf", ".", "length", "-", "pos", ")", "{", "//not enough space remaining", "byte", "[", "]", "arr", "=", "new", "byte", "[", "2", "]", ";", ...
Write short value into buffer. flush buffer if too small. @param value short value @throws IOException if socket error occur
[ "Write", "short", "value", "into", "buffer", ".", "flush", "buffer", "if", "too", "small", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L233-L246
52,625
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.writeInt
public void writeInt(int value) throws IOException { if (4 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[4]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); arr[2] = (byte) (value >> 16); arr[3] = (byte) (value >> 24); write(arr, 0, 4); ...
java
public void writeInt(int value) throws IOException { if (4 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[4]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); arr[2] = (byte) (value >> 16); arr[3] = (byte) (value >> 24); write(arr, 0, 4); ...
[ "public", "void", "writeInt", "(", "int", "value", ")", "throws", "IOException", "{", "if", "(", "4", ">", "buf", ".", "length", "-", "pos", ")", "{", "//not enough space remaining", "byte", "[", "]", "arr", "=", "new", "byte", "[", "4", "]", ";", "a...
Write int value into buffer. flush buffer if too small. @param value int value @throws IOException if socket error occur
[ "Write", "int", "value", "into", "buffer", ".", "flush", "buffer", "if", "too", "small", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L254-L271
52,626
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.writeLong
public void writeLong(long value) throws IOException { if (8 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[8]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); arr[2] = (byte) (value >> 16); arr[3] = (byte) (value >> 24); arr[4] = (byte) (valu...
java
public void writeLong(long value) throws IOException { if (8 > buf.length - pos) { //not enough space remaining byte[] arr = new byte[8]; arr[0] = (byte) value; arr[1] = (byte) (value >> 8); arr[2] = (byte) (value >> 16); arr[3] = (byte) (value >> 24); arr[4] = (byte) (valu...
[ "public", "void", "writeLong", "(", "long", "value", ")", "throws", "IOException", "{", "if", "(", "8", ">", "buf", ".", "length", "-", "pos", ")", "{", "//not enough space remaining", "byte", "[", "]", "arr", "=", "new", "byte", "[", "8", "]", ";", ...
Write long value into buffer. flush buffer if too small. @param value long value @throws IOException if socket error occur
[ "Write", "long", "value", "into", "buffer", ".", "flush", "buffer", "if", "too", "small", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L279-L304
52,627
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.writeBytes
public void writeBytes(byte value, int len) throws IOException { if (len > buf.length - pos) { //not enough space remaining byte[] arr = new byte[len]; Arrays.fill(arr, value); write(arr, 0, len); return; } for (int i = pos; i < pos + len; i++) { buf[i] = value; } ...
java
public void writeBytes(byte value, int len) throws IOException { if (len > buf.length - pos) { //not enough space remaining byte[] arr = new byte[len]; Arrays.fill(arr, value); write(arr, 0, len); return; } for (int i = pos; i < pos + len; i++) { buf[i] = value; } ...
[ "public", "void", "writeBytes", "(", "byte", "value", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "len", ">", "buf", ".", "length", "-", "pos", ")", "{", "//not enough space remaining", "byte", "[", "]", "arr", "=", "new", "byte", ...
Write byte value, len times into buffer. flush buffer if too small. @param value byte value @param len number of time to write value. @throws IOException if socket error occur.
[ "Write", "byte", "value", "len", "times", "into", "buffer", ".", "flush", "buffer", "if", "too", "small", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L313-L326
52,628
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.write
public void write(int value) throws IOException { if (pos >= buf.length) { if (pos >= getMaxPacketLength() && !bufferContainDataAfterMark) { //buffer is more than a Packet, must flushBuffer() flushBuffer(false); } else { growBuffer(1); } } buf[pos++] = (byte) value;...
java
public void write(int value) throws IOException { if (pos >= buf.length) { if (pos >= getMaxPacketLength() && !bufferContainDataAfterMark) { //buffer is more than a Packet, must flushBuffer() flushBuffer(false); } else { growBuffer(1); } } buf[pos++] = (byte) value;...
[ "public", "void", "write", "(", "int", "value", ")", "throws", "IOException", "{", "if", "(", "pos", ">=", "buf", ".", "length", ")", "{", "if", "(", "pos", ">=", "getMaxPacketLength", "(", ")", "&&", "!", "bufferContainDataAfterMark", ")", "{", "//buffe...
Write byte into buffer, flush buffer to socket if needed. @param value byte to send @throws IOException if socket error occur.
[ "Write", "byte", "into", "buffer", "flush", "buffer", "to", "socket", "if", "needed", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L413-L423
52,629
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.write
public void write(byte[] arr, int off, int len) throws IOException { if (len > buf.length - pos) { if (buf.length != getMaxPacketLength()) { growBuffer(len); } //max buffer size if (len > buf.length - pos) { if (mark != -1) { growBuffer(len); if (mark !=...
java
public void write(byte[] arr, int off, int len) throws IOException { if (len > buf.length - pos) { if (buf.length != getMaxPacketLength()) { growBuffer(len); } //max buffer size if (len > buf.length - pos) { if (mark != -1) { growBuffer(len); if (mark !=...
[ "public", "void", "write", "(", "byte", "[", "]", "arr", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "len", ">", "buf", ".", "length", "-", "pos", ")", "{", "if", "(", "buf", ".", "length", "!=", "getMaxPac...
Write byte array to buffer. If buffer is full, flush socket. @param arr byte array @param off offset @param len byte length to write @throws IOException if socket error occur
[ "Write", "byte", "array", "to", "buffer", ".", "If", "buffer", "is", "full", "flush", "socket", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L437-L475
52,630
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.write
public void write(Reader reader, boolean escape, boolean noBackslashEscapes) throws IOException { char[] buffer = new char[4096]; int len; while ((len = reader.read(buffer)) >= 0) { byte[] data = new String(buffer, 0, len).getBytes("UTF-8"); if (escape) { writeBytesEscaped(data, data.len...
java
public void write(Reader reader, boolean escape, boolean noBackslashEscapes) throws IOException { char[] buffer = new char[4096]; int len; while ((len = reader.read(buffer)) >= 0) { byte[] data = new String(buffer, 0, len).getBytes("UTF-8"); if (escape) { writeBytesEscaped(data, data.len...
[ "public", "void", "write", "(", "Reader", "reader", ",", "boolean", "escape", ",", "boolean", "noBackslashEscapes", ")", "throws", "IOException", "{", "char", "[", "]", "buffer", "=", "new", "char", "[", "4096", "]", ";", "int", "len", ";", "while", "(",...
Write reader into socket. @param reader reader @param escape must be escape @param noBackslashEscapes escape method @throws IOException if socket error occur
[ "Write", "reader", "into", "socket", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L652-L664
52,631
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.writeBytesEscaped
public void writeBytesEscaped(byte[] bytes, int len, boolean noBackslashEscapes) throws IOException { if (len * 2 > buf.length - pos) { //makes buffer bigger (up to 16M) if (buf.length != getMaxPacketLength()) { growBuffer(len * 2); } //data may be bigger than buffer. /...
java
public void writeBytesEscaped(byte[] bytes, int len, boolean noBackslashEscapes) throws IOException { if (len * 2 > buf.length - pos) { //makes buffer bigger (up to 16M) if (buf.length != getMaxPacketLength()) { growBuffer(len * 2); } //data may be bigger than buffer. /...
[ "public", "void", "writeBytesEscaped", "(", "byte", "[", "]", "bytes", ",", "int", "len", ",", "boolean", "noBackslashEscapes", ")", "throws", "IOException", "{", "if", "(", "len", "*", "2", ">", "buf", ".", "length", "-", "pos", ")", "{", "//makes buffe...
Write escape bytes to socket. @param bytes bytes @param len len to write @param noBackslashEscapes escape method @throws IOException if socket error occur
[ "Write", "escape", "bytes", "to", "socket", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L698-L776
52,632
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.flushBufferStopAtMark
@Override public void flushBufferStopAtMark() throws IOException { final int end = pos; pos = mark; flushBuffer(true); out.flush(); startPacket(0); System.arraycopy(buf, mark, buf, pos, end - mark); pos += end - mark; mark = -1; bufferContainDataAfterMark = true; }
java
@Override public void flushBufferStopAtMark() throws IOException { final int end = pos; pos = mark; flushBuffer(true); out.flush(); startPacket(0); System.arraycopy(buf, mark, buf, pos, end - mark); pos += end - mark; mark = -1; bufferContainDataAfterMark = true; }
[ "@", "Override", "public", "void", "flushBufferStopAtMark", "(", ")", "throws", "IOException", "{", "final", "int", "end", "=", "pos", ";", "pos", "=", "mark", ";", "flushBuffer", "(", "true", ")", ";", "out", ".", "flush", "(", ")", ";", "startPacket", ...
Flush to last mark. @throws IOException if flush fail.
[ "Flush", "to", "last", "mark", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L818-L830
52,633
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java
AbstractPacketOutputStream.resetMark
public byte[] resetMark() { mark = -1; if (bufferContainDataAfterMark) { byte[] data = Arrays.copyOfRange(buf, initialPacketPos(), pos); startPacket(0); bufferContainDataAfterMark = false; return data; } return null; }
java
public byte[] resetMark() { mark = -1; if (bufferContainDataAfterMark) { byte[] data = Arrays.copyOfRange(buf, initialPacketPos(), pos); startPacket(0); bufferContainDataAfterMark = false; return data; } return null; }
[ "public", "byte", "[", "]", "resetMark", "(", ")", "{", "mark", "=", "-", "1", ";", "if", "(", "bufferContainDataAfterMark", ")", "{", "byte", "[", "]", "data", "=", "Arrays", ".", "copyOfRange", "(", "buf", ",", "initialPacketPos", "(", ")", ",", "p...
Reset mark flag and send bytes after mark flag. @return bytes after mark flag
[ "Reset", "mark", "flag", "and", "send", "bytes", "after", "mark", "flag", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/AbstractPacketOutputStream.java#L841-L851
52,634
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/scheduler/SchedulerServiceProviderHolder.java
SchedulerServiceProviderHolder.getScheduler
public static DynamicSizedSchedulerInterface getScheduler(int initialThreadCount, String poolName, int maximumPoolSize) { return getSchedulerProvider().getScheduler(initialThreadCount, poolName, maximumPoolSize); }
java
public static DynamicSizedSchedulerInterface getScheduler(int initialThreadCount, String poolName, int maximumPoolSize) { return getSchedulerProvider().getScheduler(initialThreadCount, poolName, maximumPoolSize); }
[ "public", "static", "DynamicSizedSchedulerInterface", "getScheduler", "(", "int", "initialThreadCount", ",", "String", "poolName", ",", "int", "maximumPoolSize", ")", "{", "return", "getSchedulerProvider", "(", ")", ".", "getScheduler", "(", "initialThreadCount", ",", ...
Get a Dynamic sized scheduler directly with the current set provider. @param initialThreadCount Number of threads scheduler is allowed to grow to @param poolName name of pool to identify threads @param maximumPoolSize maximum pool size @return Scheduler capable of providing the needed thread count
[ "Get", "a", "Dynamic", "sized", "scheduler", "directly", "with", "the", "current", "set", "provider", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/scheduler/SchedulerServiceProviderHolder.java#L135-L138
52,635
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/socket/NamedPipeSocket.java
NamedPipeSocket.connect
public void connect(SocketAddress endpoint, int timeout) throws IOException { String filename; if (host == null || host.equals("localhost")) { filename = "\\\\.\\pipe\\" + name; } else { filename = "\\\\" + host + "\\pipe\\" + name; } //use a default timeout of 100ms if no timeout set. ...
java
public void connect(SocketAddress endpoint, int timeout) throws IOException { String filename; if (host == null || host.equals("localhost")) { filename = "\\\\.\\pipe\\" + name; } else { filename = "\\\\" + host + "\\pipe\\" + name; } //use a default timeout of 100ms if no timeout set. ...
[ "public", "void", "connect", "(", "SocketAddress", "endpoint", ",", "int", "timeout", ")", "throws", "IOException", "{", "String", "filename", ";", "if", "(", "host", "==", "null", "||", "host", ".", "equals", "(", "\"localhost\"", ")", ")", "{", "filename...
Name pipe connection. @param endpoint endPoint @param timeout timeout in milliseconds @throws IOException exception
[ "Name", "pipe", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/socket/NamedPipeSocket.java#L100-L176
52,636
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/parameters/SerializableParameter.java
SerializableParameter.writeTo
public void writeTo(final PacketOutputStream pos) throws IOException { if (loadedStream == null) { writeObjectToBytes(); } pos.write(BINARY_INTRODUCER); pos.writeBytesEscaped(loadedStream, loadedStream.length, noBackSlashEscapes); pos.write(QUOTE); }
java
public void writeTo(final PacketOutputStream pos) throws IOException { if (loadedStream == null) { writeObjectToBytes(); } pos.write(BINARY_INTRODUCER); pos.writeBytesEscaped(loadedStream, loadedStream.length, noBackSlashEscapes); pos.write(QUOTE); }
[ "public", "void", "writeTo", "(", "final", "PacketOutputStream", "pos", ")", "throws", "IOException", "{", "if", "(", "loadedStream", "==", "null", ")", "{", "writeObjectToBytes", "(", ")", ";", "}", "pos", ".", "write", "(", "BINARY_INTRODUCER", ")", ";", ...
Write object to buffer for text protocol. @param pos the stream to write to @throws IOException if error reading stream
[ "Write", "object", "to", "buffer", "for", "text", "protocol", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/SerializableParameter.java#L78-L86
52,637
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/dao/ServerPrepareResult.java
ServerPrepareResult.failover
public void failover(int statementId, Protocol unProxiedProtocol) { this.statementId = statementId; this.unProxiedProtocol = unProxiedProtocol; this.parameterTypeHeader = new ColumnType[parameters.length]; this.shareCounter = 1; this.isBeingDeallocate = false; }
java
public void failover(int statementId, Protocol unProxiedProtocol) { this.statementId = statementId; this.unProxiedProtocol = unProxiedProtocol; this.parameterTypeHeader = new ColumnType[parameters.length]; this.shareCounter = 1; this.isBeingDeallocate = false; }
[ "public", "void", "failover", "(", "int", "statementId", ",", "Protocol", "unProxiedProtocol", ")", "{", "this", ".", "statementId", "=", "statementId", ";", "this", ".", "unProxiedProtocol", "=", "unProxiedProtocol", ";", "this", ".", "parameterTypeHeader", "=", ...
Update information after a failover. @param statementId new statement Id @param unProxiedProtocol the protocol on which the prepare has been done
[ "Update", "information", "after", "a", "failover", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/dao/ServerPrepareResult.java#L103-L110
52,638
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java
MariaDbResultSetMetaData.isNullable
public int isNullable(final int column) throws SQLException { if ((getColumnInformation(column).getFlags() & ColumnFlags.NOT_NULL) == 0) { return ResultSetMetaData.columnNullable; } else { return ResultSetMetaData.columnNoNulls; } }
java
public int isNullable(final int column) throws SQLException { if ((getColumnInformation(column).getFlags() & ColumnFlags.NOT_NULL) == 0) { return ResultSetMetaData.columnNullable; } else { return ResultSetMetaData.columnNoNulls; } }
[ "public", "int", "isNullable", "(", "final", "int", "column", ")", "throws", "SQLException", "{", "if", "(", "(", "getColumnInformation", "(", "column", ")", ".", "getFlags", "(", ")", "&", "ColumnFlags", ".", "NOT_NULL", ")", "==", "0", ")", "{", "retur...
Indicates the nullability of values in the designated column. @param column the first column is 1, the second is 2, ... @return the nullability status of the given column; one of <code>columnNoNulls</code>, <code>columnNullable</code> or <code>columnNullableUnknown</code> @throws SQLException if a database access erro...
[ "Indicates", "the", "nullability", "of", "values", "in", "the", "designated", "column", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java#L144-L150
52,639
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java
MariaDbResultSetMetaData.getTableName
public String getTableName(final int column) throws SQLException { if (returnTableAlias) { return getColumnInformation(column).getTable(); } else { return getColumnInformation(column).getOriginalTable(); } }
java
public String getTableName(final int column) throws SQLException { if (returnTableAlias) { return getColumnInformation(column).getTable(); } else { return getColumnInformation(column).getOriginalTable(); } }
[ "public", "String", "getTableName", "(", "final", "int", "column", ")", "throws", "SQLException", "{", "if", "(", "returnTableAlias", ")", "{", "return", "getColumnInformation", "(", "column", ")", ".", "getTable", "(", ")", ";", "}", "else", "{", "return", ...
Gets the designated column's table name. @param column the first column is 1, the second is 2, ... @return table name or "" if not applicable @throws SQLException if a database access error occurs
[ "Gets", "the", "designated", "column", "s", "table", "name", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java#L255-L261
52,640
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java
MariaDbResultSetMetaData.getColumnType
public int getColumnType(final int column) throws SQLException { ColumnInformation ci = getColumnInformation(column); switch (ci.getColumnType()) { case BIT: if (ci.getLength() == 1) { return Types.BIT; } return Types.VARBINARY; case TINYINT: if (ci.getLengt...
java
public int getColumnType(final int column) throws SQLException { ColumnInformation ci = getColumnInformation(column); switch (ci.getColumnType()) { case BIT: if (ci.getLength() == 1) { return Types.BIT; } return Types.VARBINARY; case TINYINT: if (ci.getLengt...
[ "public", "int", "getColumnType", "(", "final", "int", "column", ")", "throws", "SQLException", "{", "ColumnInformation", "ci", "=", "getColumnInformation", "(", "column", ")", ";", "switch", "(", "ci", ".", "getColumnType", "(", ")", ")", "{", "case", "BIT"...
Retrieves the designated column's SQL type. @param column the first column is 1, the second is 2, ... @return SQL type from java.sql.Types @throws SQLException if a database access error occurs @see Types
[ "Retrieves", "the", "designated", "column", "s", "SQL", "type", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java#L276-L317
52,641
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.skipWhite
private static int skipWhite(char[] part, int startPos) { for (int i = startPos; i < part.length; i++) { if (!Character.isWhitespace(part[i])) { return i; } } return part.length; }
java
private static int skipWhite(char[] part, int startPos) { for (int i = startPos; i < part.length; i++) { if (!Character.isWhitespace(part[i])) { return i; } } return part.length; }
[ "private", "static", "int", "skipWhite", "(", "char", "[", "]", "part", ",", "int", "startPos", ")", "{", "for", "(", "int", "i", "=", "startPos", ";", "i", "<", "part", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "Character", ".", ...
Return new position, or -1 on error
[ "Return", "new", "position", "or", "-", "1", "on", "error" ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L116-L123
52,642
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.catalogCond
private String catalogCond(String columnName, String catalog) { if (catalog == null) { /* Treat null catalog as current */ if (connection.nullCatalogMeansCurrent) { return "(ISNULL(database()) OR (" + columnName + " = database()))"; } return "(1 = 1)"; } if (catalog.isEmpty()...
java
private String catalogCond(String columnName, String catalog) { if (catalog == null) { /* Treat null catalog as current */ if (connection.nullCatalogMeansCurrent) { return "(ISNULL(database()) OR (" + columnName + " = database()))"; } return "(1 = 1)"; } if (catalog.isEmpty()...
[ "private", "String", "catalogCond", "(", "String", "columnName", ",", "String", "catalog", ")", "{", "if", "(", "catalog", "==", "null", ")", "{", "/* Treat null catalog as current */", "if", "(", "connection", ".", "nullCatalogMeansCurrent", ")", "{", "return", ...
Generate part of the information schema query that restricts catalog names In the driver, catalogs is the equivalent to MariaDB schemas. @param columnName - column name in the information schema table @param catalog - catalog name. This driver does not (always) follow JDBC standard for following special values, due...
[ "Generate", "part", "of", "the", "information", "schema", "query", "that", "restricts", "catalog", "names", "In", "the", "driver", "catalogs", "is", "the", "equivalent", "to", "MariaDB", "schemas", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L502-L515
52,643
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.getPseudoColumns
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException { return connection.createStatement().executeQuery( "SELECT ' ' TABLE_CAT, ' ' TABLE_SCHEM," + "' ' TABLE_NAME, ' ' COLUMN_NAME, 0 DATA_TYPE, 0 COL...
java
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException { return connection.createStatement().executeQuery( "SELECT ' ' TABLE_CAT, ' ' TABLE_SCHEM," + "' ' TABLE_NAME, ' ' COLUMN_NAME, 0 DATA_TYPE, 0 COL...
[ "public", "ResultSet", "getPseudoColumns", "(", "String", "catalog", ",", "String", "schemaPattern", ",", "String", "tableNamePattern", ",", "String", "columnNamePattern", ")", "throws", "SQLException", "{", "return", "connection", ".", "createStatement", "(", ")", ...
Retrieves a description of the pseudo or hidden columns available in a given table within the specified catalog and schema. Pseudo or hidden columns may not always be stored within a table and are not visible in a ResultSet unless they are specified in the query's outermost SELECT list. Pseudo or hidden columns may not...
[ "Retrieves", "a", "description", "of", "the", "pseudo", "or", "hidden", "columns", "available", "in", "a", "given", "table", "within", "the", "specified", "catalog", "and", "schema", ".", "Pseudo", "or", "hidden", "columns", "may", "not", "always", "be", "st...
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L1085-L1092
52,644
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.getDatabaseProductName
public String getDatabaseProductName() throws SQLException { if (urlParser.getOptions().useMysqlMetadata) { return "MySQL"; } if (connection.getProtocol().isServerMariaDb() && connection.getProtocol().getServerVersion().toLowerCase(Locale.ROOT).contains("mariadb")) { return "MariaDB"...
java
public String getDatabaseProductName() throws SQLException { if (urlParser.getOptions().useMysqlMetadata) { return "MySQL"; } if (connection.getProtocol().isServerMariaDb() && connection.getProtocol().getServerVersion().toLowerCase(Locale.ROOT).contains("mariadb")) { return "MariaDB"...
[ "public", "String", "getDatabaseProductName", "(", ")", "throws", "SQLException", "{", "if", "(", "urlParser", ".", "getOptions", "(", ")", ".", "useMysqlMetadata", ")", "{", "return", "\"MySQL\"", ";", "}", "if", "(", "connection", ".", "getProtocol", "(", ...
Return Server type. MySQL or MariaDB. MySQL can be forced for compatibility with option "useMysqlMetadata" @return server type @throws SQLException in case of socket error.
[ "Return", "Server", "type", ".", "MySQL", "or", "MariaDB", ".", "MySQL", "can", "be", "forced", "for", "compatibility", "with", "option", "useMysqlMetadata" ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L1138-L1147
52,645
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.getVersionColumns
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException { String sql = "SELECT 0 SCOPE, ' ' COLUMN_NAME, 0 DATA_TYPE," + " ' ' TYPE_NAME, 0 COLUMN_SIZE, 0 BUFFER_LENGTH," + " 0 DECIMAL_DIGITS, 0 PSEUDO_COLUMN " + " FROM DU...
java
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException { String sql = "SELECT 0 SCOPE, ' ' COLUMN_NAME, 0 DATA_TYPE," + " ' ' TYPE_NAME, 0 COLUMN_SIZE, 0 BUFFER_LENGTH," + " 0 DECIMAL_DIGITS, 0 PSEUDO_COLUMN " + " FROM DU...
[ "public", "ResultSet", "getVersionColumns", "(", "String", "catalog", ",", "String", "schema", ",", "String", "table", ")", "throws", "SQLException", "{", "String", "sql", "=", "\"SELECT 0 SCOPE, ' ' COLUMN_NAME, 0 DATA_TYPE,\"", "+", "\" ' ' TYPE_NAME, 0 COLUMN_SIZE, 0 BUF...
Retrieves a description of a table's columns that are automatically updated when any value in a row is updated. They are unordered. <P>Each column description has the following columns:</p> <OL> <LI><B>SCOPE</B> short {@code =>} is not used <LI><B>COLUMN_NAME</B> String {@code =>} column name <LI><B>DATA_TYPE</B> in...
[ "Retrieves", "a", "description", "of", "a", "table", "s", "columns", "that", "are", "automatically", "updated", "when", "any", "value", "in", "a", "row", "is", "updated", ".", "They", "are", "unordered", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L2183-L2191
52,646
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/tls/SslFactory.java
SslFactory.getSslSocketFactory
public static SSLSocketFactory getSslSocketFactory(Options options) throws SQLException { TrustManager[] trustManager = null; KeyManager[] keyManager = null; if (options.trustServerCertificate || options.serverSslCert != null || options.trustStore != null) { trustManager = new X509TrustManag...
java
public static SSLSocketFactory getSslSocketFactory(Options options) throws SQLException { TrustManager[] trustManager = null; KeyManager[] keyManager = null; if (options.trustServerCertificate || options.serverSslCert != null || options.trustStore != null) { trustManager = new X509TrustManag...
[ "public", "static", "SSLSocketFactory", "getSslSocketFactory", "(", "Options", "options", ")", "throws", "SQLException", "{", "TrustManager", "[", "]", "trustManager", "=", "null", ";", "KeyManager", "[", "]", "keyManager", "=", "null", ";", "if", "(", "options"...
Create an SSL factory according to connection string options. @param options connection options @return SSL socket factory @throws SQLException in case of error initializing context.
[ "Create", "an", "SSL", "factory", "according", "to", "connection", "string", "options", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/tls/SslFactory.java#L34-L71
52,647
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java
ClientSidePreparedStatement.clearBatch
@Override public void clearBatch() { parameterList.clear(); hasLongData = false; this.parameters = new ParameterHolder[prepareResult.getParamCount()]; }
java
@Override public void clearBatch() { parameterList.clear(); hasLongData = false; this.parameters = new ParameterHolder[prepareResult.getParamCount()]; }
[ "@", "Override", "public", "void", "clearBatch", "(", ")", "{", "parameterList", ".", "clear", "(", ")", ";", "hasLongData", "=", "false", ";", "this", ".", "parameters", "=", "new", "ParameterHolder", "[", "prepareResult", ".", "getParamCount", "(", ")", ...
Clear batch.
[ "Clear", "batch", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java#L277-L282
52,648
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java
ClientSidePreparedStatement.executeInternalBatch
private void executeInternalBatch(int size) throws SQLException { executeQueryPrologue(true); results = new Results(this, 0, true, size, false, resultSetScrollType, resultSetConcurrency, autoGeneratedKeys, protocol.getAutoIncrementIncrement()); if (protocol .executeBatchClient(protocol.i...
java
private void executeInternalBatch(int size) throws SQLException { executeQueryPrologue(true); results = new Results(this, 0, true, size, false, resultSetScrollType, resultSetConcurrency, autoGeneratedKeys, protocol.getAutoIncrementIncrement()); if (protocol .executeBatchClient(protocol.i...
[ "private", "void", "executeInternalBatch", "(", "int", "size", ")", "throws", "SQLException", "{", "executeQueryPrologue", "(", "true", ")", ";", "results", "=", "new", "Results", "(", "this", ",", "0", ",", "true", ",", "size", ",", "false", ",", "resultS...
Choose better way to execute queries according to query and options. @param size parameters number @throws SQLException if any error occur
[ "Choose", "better", "way", "to", "execute", "queries", "according", "to", "query", "and", "options", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java#L355-L401
52,649
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java
ClientSidePreparedStatement.setParameter
public void setParameter(final int parameterIndex, final ParameterHolder holder) throws SQLException { if (parameterIndex >= 1 && parameterIndex < prepareResult.getParamCount() + 1) { parameters[parameterIndex - 1] = holder; } else { String error = "Could not set parameter at position " + para...
java
public void setParameter(final int parameterIndex, final ParameterHolder holder) throws SQLException { if (parameterIndex >= 1 && parameterIndex < prepareResult.getParamCount() + 1) { parameters[parameterIndex - 1] = holder; } else { String error = "Could not set parameter at position " + para...
[ "public", "void", "setParameter", "(", "final", "int", "parameterIndex", ",", "final", "ParameterHolder", "holder", ")", "throws", "SQLException", "{", "if", "(", "parameterIndex", ">=", "1", "&&", "parameterIndex", "<", "prepareResult", ".", "getParamCount", "(",...
Set parameter. @param parameterIndex index @param holder parameter holder @throws SQLException if index position doesn't correspond to query parameters
[ "Set", "parameter", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java#L442-L467
52,650
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java
ClientSidePreparedStatement.close
@Override public void close() throws SQLException { super.close(); if (connection == null || connection.pooledConnection == null || connection.pooledConnection.noStmtEventListeners()) { return; } connection.pooledConnection.fireStatementClosed(this); connection = null; }
java
@Override public void close() throws SQLException { super.close(); if (connection == null || connection.pooledConnection == null || connection.pooledConnection.noStmtEventListeners()) { return; } connection.pooledConnection.fireStatementClosed(this); connection = null; }
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "SQLException", "{", "super", ".", "close", "(", ")", ";", "if", "(", "connection", "==", "null", "||", "connection", ".", "pooledConnection", "==", "null", "||", "connection", ".", "pooledCon...
Close prepared statement, maybe fire closed-statement events
[ "Close", "prepared", "statement", "maybe", "fire", "closed", "-", "statement", "events" ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java#L520-L529
52,651
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/io/output/CompressPacketOutputStream.java
CompressPacketOutputStream.writeEmptyPacket
public void writeEmptyPacket() throws IOException { buf[0] = (byte) 4; buf[1] = (byte) 0x00; buf[2] = (byte) 0x00; buf[3] = (byte) this.compressSeqNo++; buf[4] = (byte) 0x00; buf[5] = (byte) 0x00; buf[6] = (byte) 0x00; buf[7] = (byte) 0x00; buf[8] = (byte) 0x00; buf[9] = (byte) 0...
java
public void writeEmptyPacket() throws IOException { buf[0] = (byte) 4; buf[1] = (byte) 0x00; buf[2] = (byte) 0x00; buf[3] = (byte) this.compressSeqNo++; buf[4] = (byte) 0x00; buf[5] = (byte) 0x00; buf[6] = (byte) 0x00; buf[7] = (byte) 0x00; buf[8] = (byte) 0x00; buf[9] = (byte) 0...
[ "public", "void", "writeEmptyPacket", "(", ")", "throws", "IOException", "{", "buf", "[", "0", "]", "=", "(", "byte", ")", "4", ";", "buf", "[", "1", "]", "=", "(", "byte", ")", "0x00", ";", "buf", "[", "2", "]", "=", "(", "byte", ")", "0x00", ...
Write an empty packet. @throws IOException if socket error occur.
[ "Write", "an", "empty", "packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/output/CompressPacketOutputStream.java#L394-L418
52,652
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/authentication/DefaultAuthenticationProvider.java
DefaultAuthenticationProvider.processAuthPlugin
public static AuthenticationPlugin processAuthPlugin(String plugin, String password, byte[] authData, Options options) throws SQLException { swit...
java
public static AuthenticationPlugin processAuthPlugin(String plugin, String password, byte[] authData, Options options) throws SQLException { swit...
[ "public", "static", "AuthenticationPlugin", "processAuthPlugin", "(", "String", "plugin", ",", "String", "password", ",", "byte", "[", "]", "authData", ",", "Options", "options", ")", "throws", "SQLException", "{", "switch", "(", "plugin", ")", "{", "case", "M...
Process AuthenticationSwitch. @param plugin plugin name @param password password @param authData auth data @param options connection string options @return authentication response according to parameters @throws SQLException if error occur.
[ "Process", "AuthenticationSwitch", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/authentication/DefaultAuthenticationProvider.java#L86-L110
52,653
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java
AuroraProtocol.searchProbableMaster
private static void searchProbableMaster(AuroraListener listener, final GlobalStateInfo globalInfo, HostAddress probableMaster) { AuroraProtocol protocol = getNewProtocol(listener.getProxy(), globalInfo, listener.getUrlParser()); try { protocol.setHostAddress(probableMaster); p...
java
private static void searchProbableMaster(AuroraListener listener, final GlobalStateInfo globalInfo, HostAddress probableMaster) { AuroraProtocol protocol = getNewProtocol(listener.getProxy(), globalInfo, listener.getUrlParser()); try { protocol.setHostAddress(probableMaster); p...
[ "private", "static", "void", "searchProbableMaster", "(", "AuroraListener", "listener", ",", "final", "GlobalStateInfo", "globalInfo", ",", "HostAddress", "probableMaster", ")", "{", "AuroraProtocol", "protocol", "=", "getNewProtocol", "(", "listener", ".", "getProxy", ...
Connect aurora probable master. Aurora master change in time. The only way to check that a server is a master is to asked him. @param listener aurora failover to call back if master is found @param globalInfo server global variables information @param probableMaster probable master host
[ "Connect", "aurora", "probable", "master", ".", "Aurora", "master", "change", "in", "time", ".", "The", "only", "way", "to", "check", "that", "a", "server", "is", "a", "master", "is", "to", "asked", "him", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java#L89-L115
52,654
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java
AuroraProtocol.getNewProtocol
public static AuroraProtocol getNewProtocol(FailoverProxy proxy, final GlobalStateInfo globalInfo, UrlParser urlParser) { AuroraProtocol newProtocol = new AuroraProtocol(urlParser, globalInfo, proxy.lock); newProtocol.setProxy(proxy); return newProtocol; }
java
public static AuroraProtocol getNewProtocol(FailoverProxy proxy, final GlobalStateInfo globalInfo, UrlParser urlParser) { AuroraProtocol newProtocol = new AuroraProtocol(urlParser, globalInfo, proxy.lock); newProtocol.setProxy(proxy); return newProtocol; }
[ "public", "static", "AuroraProtocol", "getNewProtocol", "(", "FailoverProxy", "proxy", ",", "final", "GlobalStateInfo", "globalInfo", ",", "UrlParser", "urlParser", ")", "{", "AuroraProtocol", "newProtocol", "=", "new", "AuroraProtocol", "(", "urlParser", ",", "global...
Initialize new protocol instance. @param proxy proxy @param globalInfo server global variables information @param urlParser connection string data's @return new AuroraProtocol
[ "Initialize", "new", "protocol", "instance", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java#L335-L340
52,655
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/dao/CmdInformationBatch.java
CmdInformationBatch.reset
@Override public void reset() { insertIds.clear(); updateCounts.clear(); insertIdNumber = 0; hasException = false; rewritten = false; }
java
@Override public void reset() { insertIds.clear(); updateCounts.clear(); insertIdNumber = 0; hasException = false; rewritten = false; }
[ "@", "Override", "public", "void", "reset", "(", ")", "{", "insertIds", ".", "clear", "(", ")", ";", "updateCounts", ".", "clear", "(", ")", ";", "insertIdNumber", "=", "0", ";", "hasException", "=", "false", ";", "rewritten", "=", "false", ";", "}" ]
Clear error state, used for clear exception after first batch query, when fall back to per-query execution.
[ "Clear", "error", "state", "used", "for", "clear", "exception", "after", "first", "batch", "query", "when", "fall", "back", "to", "per", "-", "query", "execution", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/CmdInformationBatch.java#L98-L105
52,656
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java
SelectResultSet.readNextValue
private boolean readNextValue() throws IOException, SQLException { byte[] buf = reader.getPacketArray(false); //is error Packet if (buf[0] == ERROR) { protocol.removeActiveStreamingResult(); protocol.removeHasMoreResults(); protocol.setHasWarnings(false); ErrorPacket errorPacket = n...
java
private boolean readNextValue() throws IOException, SQLException { byte[] buf = reader.getPacketArray(false); //is error Packet if (buf[0] == ERROR) { protocol.removeActiveStreamingResult(); protocol.removeHasMoreResults(); protocol.setHasWarnings(false); ErrorPacket errorPacket = n...
[ "private", "boolean", "readNextValue", "(", ")", "throws", "IOException", ",", "SQLException", "{", "byte", "[", "]", "buf", "=", "reader", ".", "getPacketArray", "(", "false", ")", ";", "//is error Packet", "if", "(", "buf", "[", "0", "]", "==", "ERROR", ...
Read next value. @return true if have a new value @throws IOException exception @throws SQLException exception
[ "Read", "next", "value", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java#L430-L492
52,657
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java
SelectResultSet.deleteCurrentRowData
protected void deleteCurrentRowData() throws SQLException { //move data System.arraycopy(data, rowPointer + 1, data, rowPointer, dataSize - 1 - rowPointer); data[dataSize - 1] = null; dataSize--; lastRowPointer = -1; previous(); }
java
protected void deleteCurrentRowData() throws SQLException { //move data System.arraycopy(data, rowPointer + 1, data, rowPointer, dataSize - 1 - rowPointer); data[dataSize - 1] = null; dataSize--; lastRowPointer = -1; previous(); }
[ "protected", "void", "deleteCurrentRowData", "(", ")", "throws", "SQLException", "{", "//move data", "System", ".", "arraycopy", "(", "data", ",", "rowPointer", "+", "1", ",", "data", ",", "rowPointer", ",", "dataSize", "-", "1", "-", "rowPointer", ")", ";",...
Delete current data. Position cursor to the previous row. @throws SQLException if previous() fail.
[ "Delete", "current", "data", ".", "Position", "cursor", "to", "the", "previous", "row", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java#L519-L526
52,658
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java
SelectResultSet.close
public void close() throws SQLException { isClosed = true; if (!isEof) { lock.lock(); try { while (!isEof) { dataSize = 0; //to avoid storing data readNextValue(); } } catch (SQLException queryException) { throw ExceptionMapper.getException(queryExc...
java
public void close() throws SQLException { isClosed = true; if (!isEof) { lock.lock(); try { while (!isEof) { dataSize = 0; //to avoid storing data readNextValue(); } } catch (SQLException queryException) { throw ExceptionMapper.getException(queryExc...
[ "public", "void", "close", "(", ")", "throws", "SQLException", "{", "isClosed", "=", "true", ";", "if", "(", "!", "isEof", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "while", "(", "!", "isEof", ")", "{", "dataSize", "=", "0", ";", ...
Close resultSet.
[ "Close", "resultSet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java#L596-L626
52,659
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
CallableProcedureStatement.nameToIndex
private int nameToIndex(String parameterName) throws SQLException { parameterMetadata.readMetadataFromDbIfRequired(); for (int i = 1; i <= parameterMetadata.getParameterCount(); i++) { String name = parameterMetadata.getName(i); if (name != null && name.equalsIgnoreCase(parameterName)) { ret...
java
private int nameToIndex(String parameterName) throws SQLException { parameterMetadata.readMetadataFromDbIfRequired(); for (int i = 1; i <= parameterMetadata.getParameterCount(); i++) { String name = parameterMetadata.getName(i); if (name != null && name.equalsIgnoreCase(parameterName)) { ret...
[ "private", "int", "nameToIndex", "(", "String", "parameterName", ")", "throws", "SQLException", "{", "parameterMetadata", ".", "readMetadataFromDbIfRequired", "(", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "parameterMetadata", ".", "getParamete...
Convert parameter name to parameter index in the query. @param parameterName name @return index @throws SQLException exception
[ "Convert", "parameter", "name", "to", "parameter", "index", "in", "the", "query", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java#L158-L167
52,660
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
CallableProcedureStatement.nameToOutputIndex
private int nameToOutputIndex(String parameterName) throws SQLException { parameterMetadata.readMetadataFromDbIfRequired(); for (int i = 0; i < parameterMetadata.getParameterCount(); i++) { String name = parameterMetadata.getName(i + 1); if (name != null && name.equalsIgnoreCase(parameterName)) { ...
java
private int nameToOutputIndex(String parameterName) throws SQLException { parameterMetadata.readMetadataFromDbIfRequired(); for (int i = 0; i < parameterMetadata.getParameterCount(); i++) { String name = parameterMetadata.getName(i + 1); if (name != null && name.equalsIgnoreCase(parameterName)) { ...
[ "private", "int", "nameToOutputIndex", "(", "String", "parameterName", ")", "throws", "SQLException", "{", "parameterMetadata", ".", "readMetadataFromDbIfRequired", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterMetadata", ".", "getPar...
Convert parameter name to output parameter index in the query. @param parameterName name @return index @throws SQLException exception
[ "Convert", "parameter", "name", "to", "output", "parameter", "index", "in", "the", "query", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java#L177-L191
52,661
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
CallableProcedureStatement.indexToOutputIndex
private int indexToOutputIndex(int parameterIndex) throws SQLException { try { if (outputParameterMapper[parameterIndex - 1] == -1) { //this is not an outputParameter throw new SQLException("Parameter in index '" + parameterIndex + "' is not declared as output parameter with method...
java
private int indexToOutputIndex(int parameterIndex) throws SQLException { try { if (outputParameterMapper[parameterIndex - 1] == -1) { //this is not an outputParameter throw new SQLException("Parameter in index '" + parameterIndex + "' is not declared as output parameter with method...
[ "private", "int", "indexToOutputIndex", "(", "int", "parameterIndex", ")", "throws", "SQLException", "{", "try", "{", "if", "(", "outputParameterMapper", "[", "parameterIndex", "-", "1", "]", "==", "-", "1", ")", "{", "//this is not an outputParameter", "throw", ...
Convert parameter index to corresponding outputIndex. @param parameterIndex index @return index @throws SQLException exception
[ "Convert", "parameter", "index", "to", "corresponding", "outputIndex", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java#L200-L215
52,662
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/parameters/ReaderParameter.java
ReaderParameter.writeTo
public void writeTo(PacketOutputStream pos) throws IOException { pos.write(QUOTE); if (length == Long.MAX_VALUE) { pos.write(reader, true, noBackslashEscapes); } else { pos.write(reader, length, true, noBackslashEscapes); } pos.write(QUOTE); }
java
public void writeTo(PacketOutputStream pos) throws IOException { pos.write(QUOTE); if (length == Long.MAX_VALUE) { pos.write(reader, true, noBackslashEscapes); } else { pos.write(reader, length, true, noBackslashEscapes); } pos.write(QUOTE); }
[ "public", "void", "writeTo", "(", "PacketOutputStream", "pos", ")", "throws", "IOException", "{", "pos", ".", "write", "(", "QUOTE", ")", ";", "if", "(", "length", "==", "Long", ".", "MAX_VALUE", ")", "{", "pos", ".", "write", "(", "reader", ",", "true...
Write reader to database in text format. @param pos database outputStream @throws IOException if any error occur when reading reader
[ "Write", "reader", "to", "database", "in", "text", "format", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/ReaderParameter.java#L89-L97
52,663
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.reset
@Override public void reset() throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_RESET_CONNECTION); writer.flush(); getResult(new Results()); //clear prepare statement cache if (options.cachePrepStmts && options.useServerPrepStmts) { ...
java
@Override public void reset() throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_RESET_CONNECTION); writer.flush(); getResult(new Results()); //clear prepare statement cache if (options.cachePrepStmts && options.useServerPrepStmts) { ...
[ "@", "Override", "public", "void", "reset", "(", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "try", "{", "writer", ".", "startPacket", "(", "0", ")", ";", "writer", ".", "write", "(", "COM_RESET_CONNECTION", ")", ";", "writer", ".",...
Reset connection state. <ol> <li>Transaction will be rollback</li> <li>transaction isolation will be reset</li> <li>user variables will be removed</li> <li>sessions variables will be reset to global values</li> </ol> @throws SQLException if command failed
[ "Reset", "connection", "state", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L172-L194
52,664
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeQuery
@Override public void executeQuery(boolean mustExecuteOnMaster, Results results, final String sql) throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_QUERY); writer.write(sql); writer.flush(); getResult(results); } catch (SQLException ...
java
@Override public void executeQuery(boolean mustExecuteOnMaster, Results results, final String sql) throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_QUERY); writer.write(sql); writer.flush(); getResult(results); } catch (SQLException ...
[ "@", "Override", "public", "void", "executeQuery", "(", "boolean", "mustExecuteOnMaster", ",", "Results", "results", ",", "final", "String", "sql", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "try", "{", "writer", ".", "startPacket", "(",...
Execute query directly to outputStream. @param mustExecuteOnMaster was intended to be launched on master connection @param results result @param sql the query to executeInternal @throws SQLException exception
[ "Execute", "query", "directly", "to", "outputStream", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L216-L238
52,665
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeQuery
public void executeQuery(boolean mustExecuteOnMaster, Results results, final ClientPrepareResult clientPrepareResult, ParameterHolder[] parameters) throws SQLException { cmdPrologue(); try { if (clientPrepareResult.getParamCount() == 0 && !clientPrepareResult .isQueryMultiValuesRewr...
java
public void executeQuery(boolean mustExecuteOnMaster, Results results, final ClientPrepareResult clientPrepareResult, ParameterHolder[] parameters) throws SQLException { cmdPrologue(); try { if (clientPrepareResult.getParamCount() == 0 && !clientPrepareResult .isQueryMultiValuesRewr...
[ "public", "void", "executeQuery", "(", "boolean", "mustExecuteOnMaster", ",", "Results", "results", ",", "final", "ClientPrepareResult", "clientPrepareResult", ",", "ParameterHolder", "[", "]", "parameters", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")",...
Execute a unique clientPrepareQuery. @param mustExecuteOnMaster was intended to be launched on master connection @param results results @param clientPrepareResult clientPrepareResult @param parameters parameters @throws SQLException exception
[ "Execute", "a", "unique", "clientPrepareQuery", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L270-L295
52,666
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeBatch
private void executeBatch(Results results, final List<String> queries) throws SQLException { if (!options.useBatchMultiSend) { String sql = null; SQLException exception = null; for (int i = 0; i < queries.size() && !isInterrupted(); i++) { try { sql = queries.get(i); ...
java
private void executeBatch(Results results, final List<String> queries) throws SQLException { if (!options.useBatchMultiSend) { String sql = null; SQLException exception = null; for (int i = 0; i < queries.size() && !isInterrupted(); i++) { try { sql = queries.get(i); ...
[ "private", "void", "executeBatch", "(", "Results", "results", ",", "final", "List", "<", "String", ">", "queries", ")", "throws", "SQLException", "{", "if", "(", "!", "options", ".", "useBatchMultiSend", ")", "{", "String", "sql", "=", "null", ";", "SQLExc...
Execute list of queries not rewritable. @param results result object @param queries list of queries @throws SQLException exception
[ "Execute", "list", "of", "queries", "not", "rewritable", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L702-L783
52,667
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.prepare
@Override public ServerPrepareResult prepare(String sql, boolean executeOnMaster) throws SQLException { cmdPrologue(); lock.lock(); try { if (options.cachePrepStmts && options.useServerPrepStmts) { ServerPrepareResult pr = serverPrepareStatementCache.get(database + "-" + sql); if ...
java
@Override public ServerPrepareResult prepare(String sql, boolean executeOnMaster) throws SQLException { cmdPrologue(); lock.lock(); try { if (options.cachePrepStmts && options.useServerPrepStmts) { ServerPrepareResult pr = serverPrepareStatementCache.get(database + "-" + sql); if ...
[ "@", "Override", "public", "ServerPrepareResult", "prepare", "(", "String", "sql", ",", "boolean", "executeOnMaster", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "options", "....
Prepare query on server side. Will permit to know the parameter number of the query, and permit to send only the data on next results. <p>For failover, two additional information are in the result-set object : - current connection : Since server maintain a state of this prepare statement, all query will be executed on...
[ "Prepare", "query", "on", "server", "side", ".", "Will", "permit", "to", "know", "the", "parameter", "number", "of", "the", "query", "and", "permit", "to", "send", "only", "the", "data", "on", "next", "results", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L801-L828
52,668
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeBatchRewrite
private void executeBatchRewrite(Results results, final ClientPrepareResult prepareResult, List<ParameterHolder[]> parameterList, boolean rewriteValues) throws SQLException { cmdPrologue(); ParameterHolder[] parameters; int currentIndex = 0; int totalParameterList = parameterList.size(); ...
java
private void executeBatchRewrite(Results results, final ClientPrepareResult prepareResult, List<ParameterHolder[]> parameterList, boolean rewriteValues) throws SQLException { cmdPrologue(); ParameterHolder[] parameters; int currentIndex = 0; int totalParameterList = parameterList.size(); ...
[ "private", "void", "executeBatchRewrite", "(", "Results", "results", ",", "final", "ClientPrepareResult", "prepareResult", ",", "List", "<", "ParameterHolder", "[", "]", ">", "parameterList", ",", "boolean", "rewriteValues", ")", "throws", "SQLException", "{", "cmdP...
Specific execution for batch rewrite that has specific query for memory. @param results result @param prepareResult prepareResult @param parameterList parameters @param rewriteValues is rewritable flag @throws SQLException exception
[ "Specific", "execution", "for", "batch", "rewrite", "that", "has", "specific", "query", "for", "memory", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L892-L924
52,669
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeBatchServer
public boolean executeBatchServer(boolean mustExecuteOnMaster, ServerPrepareResult serverPrepareResult, Results results, String sql, final List<ParameterHolder[]> parametersList, boolean hasLongData) throws SQLException { cmdPrologue(); if (options.useBulkStmts && !hasLongData ...
java
public boolean executeBatchServer(boolean mustExecuteOnMaster, ServerPrepareResult serverPrepareResult, Results results, String sql, final List<ParameterHolder[]> parametersList, boolean hasLongData) throws SQLException { cmdPrologue(); if (options.useBulkStmts && !hasLongData ...
[ "public", "boolean", "executeBatchServer", "(", "boolean", "mustExecuteOnMaster", ",", "ServerPrepareResult", "serverPrepareResult", ",", "Results", "results", ",", "String", "sql", ",", "final", "List", "<", "ParameterHolder", "[", "]", ">", "parametersList", ",", ...
Execute Prepare if needed, and execute COM_STMT_EXECUTE queries in batch. @param mustExecuteOnMaster must normally be executed on master connection @param serverPrepareResult prepare result. can be null if not prepared. @param results execution results @param sql sql query if needed to be p...
[ "Execute", "Prepare", "if", "needed", "and", "execute", "COM_STMT_EXECUTE", "queries", "in", "batch", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L938-L1011
52,670
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executePreparedQuery
@Override public void executePreparedQuery(boolean mustExecuteOnMaster, ServerPrepareResult serverPrepareResult, Results results, ParameterHolder[] parameters) throws SQLException { cmdPrologue(); try { int parameterCount = serverPrepareResult.getParameters().length; //send b...
java
@Override public void executePreparedQuery(boolean mustExecuteOnMaster, ServerPrepareResult serverPrepareResult, Results results, ParameterHolder[] parameters) throws SQLException { cmdPrologue(); try { int parameterCount = serverPrepareResult.getParameters().length; //send b...
[ "@", "Override", "public", "void", "executePreparedQuery", "(", "boolean", "mustExecuteOnMaster", ",", "ServerPrepareResult", "serverPrepareResult", ",", "Results", "results", ",", "ParameterHolder", "[", "]", "parameters", ")", "throws", "SQLException", "{", "cmdProlog...
Execute a query that is already prepared. @param mustExecuteOnMaster must execute on master @param serverPrepareResult prepare result @param results execution result @param parameters parameters @throws SQLException exception
[ "Execute", "a", "query", "that", "is", "already", "prepared", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1022-L1056
52,671
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.rollback
public void rollback() throws SQLException { cmdPrologue(); lock.lock(); try { if (inTransaction()) { executeQuery("ROLLBACK"); } } catch (Exception e) { /* eat exception */ } finally { lock.unlock(); } }
java
public void rollback() throws SQLException { cmdPrologue(); lock.lock(); try { if (inTransaction()) { executeQuery("ROLLBACK"); } } catch (Exception e) { /* eat exception */ } finally { lock.unlock(); } }
[ "public", "void", "rollback", "(", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "inTransaction", "(", ")", ")", "{", "executeQuery", "(", "\"ROLLBACK\"", ")", ";", "}", "...
Rollback transaction.
[ "Rollback", "transaction", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1061-L1077
52,672
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.forceReleasePrepareStatement
public boolean forceReleasePrepareStatement(int statementId) throws SQLException { if (lock.tryLock()) { try { checkClose(); try { writer.startPacket(0); writer.write(COM_STMT_CLOSE); writer.writeInt(statementId); writer.flush(); return tru...
java
public boolean forceReleasePrepareStatement(int statementId) throws SQLException { if (lock.tryLock()) { try { checkClose(); try { writer.startPacket(0); writer.write(COM_STMT_CLOSE); writer.writeInt(statementId); writer.flush(); return tru...
[ "public", "boolean", "forceReleasePrepareStatement", "(", "int", "statementId", ")", "throws", "SQLException", "{", "if", "(", "lock", ".", "tryLock", "(", ")", ")", "{", "try", "{", "checkClose", "(", ")", ";", "try", "{", "writer", ".", "startPacket", "(...
Force release of prepare statement that are not used. This method will be call when adding a new prepare statement in cache, so the packet can be send to server without problem. @param statementId prepared statement Id to remove. @return true if successfully released @throws SQLException if connection exception.
[ "Force", "release", "of", "prepare", "statement", "that", "are", "not", "used", ".", "This", "method", "will", "be", "call", "when", "adding", "a", "new", "prepare", "statement", "in", "cache", "so", "the", "packet", "can", "be", "send", "to", "server", ...
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1087-L1117
52,673
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.cancelCurrentQuery
@Override public void cancelCurrentQuery() throws SQLException { try (MasterProtocol copiedProtocol = new MasterProtocol(urlParser, new GlobalStateInfo(), new ReentrantLock())) { copiedProtocol.setHostAddress(getHostAddress()); copiedProtocol.connect(); //no lock, because there is alread...
java
@Override public void cancelCurrentQuery() throws SQLException { try (MasterProtocol copiedProtocol = new MasterProtocol(urlParser, new GlobalStateInfo(), new ReentrantLock())) { copiedProtocol.setHostAddress(getHostAddress()); copiedProtocol.connect(); //no lock, because there is alread...
[ "@", "Override", "public", "void", "cancelCurrentQuery", "(", ")", "throws", "SQLException", "{", "try", "(", "MasterProtocol", "copiedProtocol", "=", "new", "MasterProtocol", "(", "urlParser", ",", "new", "GlobalStateInfo", "(", ")", ",", "new", "ReentrantLock", ...
Cancels the current query - clones the current protocol and executes a query using the new connection. @throws SQLException never thrown
[ "Cancels", "the", "current", "query", "-", "clones", "the", "current", "protocol", "and", "executes", "a", "query", "using", "the", "new", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1270-L1280
52,674
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.releasePrepareStatement
@Override public void releasePrepareStatement(ServerPrepareResult serverPrepareResult) throws SQLException { //If prepared cache is enable, the ServerPrepareResult can be shared in many PrepStatement, //so synchronised use count indicator will be decrement. serverPrepareResult.decrementShareCounter(); ...
java
@Override public void releasePrepareStatement(ServerPrepareResult serverPrepareResult) throws SQLException { //If prepared cache is enable, the ServerPrepareResult can be shared in many PrepStatement, //so synchronised use count indicator will be decrement. serverPrepareResult.decrementShareCounter(); ...
[ "@", "Override", "public", "void", "releasePrepareStatement", "(", "ServerPrepareResult", "serverPrepareResult", ")", "throws", "SQLException", "{", "//If prepared cache is enable, the ServerPrepareResult can be shared in many PrepStatement,", "//so synchronised use count indicator will be...
Deallocate prepare statement if not used anymore. @param serverPrepareResult allocation result @throws SQLException if de-allocation failed.
[ "Deallocate", "prepare", "statement", "if", "not", "used", "anymore", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1308-L1318
52,675
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.setTimeout
@Override public void setTimeout(int timeout) throws SocketException { lock.lock(); try { this.socket.setSoTimeout(timeout); } finally { lock.unlock(); } }
java
@Override public void setTimeout(int timeout) throws SocketException { lock.lock(); try { this.socket.setSoTimeout(timeout); } finally { lock.unlock(); } }
[ "@", "Override", "public", "void", "setTimeout", "(", "int", "timeout", ")", "throws", "SocketException", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "this", ".", "socket", ".", "setSoTimeout", "(", "timeout", ")", ";", "}", "finally", "{", "l...
Sets the connection timeout. @param timeout the timeout, in milliseconds @throws SocketException if there is an error in the underlying protocol, such as a TCP error.
[ "Sets", "the", "connection", "timeout", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1358-L1366
52,676
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.setTransactionIsolation
public void setTransactionIsolation(final int level) throws SQLException { cmdPrologue(); lock.lock(); try { String query = "SET SESSION TRANSACTION ISOLATION LEVEL"; switch (level) { case Connection.TRANSACTION_READ_UNCOMMITTED: query += " READ UNCOMMITTED"; break; ...
java
public void setTransactionIsolation(final int level) throws SQLException { cmdPrologue(); lock.lock(); try { String query = "SET SESSION TRANSACTION ISOLATION LEVEL"; switch (level) { case Connection.TRANSACTION_READ_UNCOMMITTED: query += " READ UNCOMMITTED"; break; ...
[ "public", "void", "setTransactionIsolation", "(", "final", "int", "level", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "lock", ".", "lock", "(", ")", ";", "try", "{", "String", "query", "=", "\"SET SESSION TRANSACTION ISOLATION LEVEL\"", ";...
Set transaction isolation. @param level transaction level. @throws SQLException if transaction level is unknown
[ "Set", "transaction", "isolation", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1374-L1400
52,677
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readPacket
private void readPacket(Results results) throws SQLException { Buffer buffer; try { buffer = reader.getPacket(true); } catch (IOException e) { throw handleIoException(e); } switch (buffer.getByteAt(0)) { //**************************************************************************...
java
private void readPacket(Results results) throws SQLException { Buffer buffer; try { buffer = reader.getPacket(true); } catch (IOException e) { throw handleIoException(e); } switch (buffer.getByteAt(0)) { //**************************************************************************...
[ "private", "void", "readPacket", "(", "Results", "results", ")", "throws", "SQLException", "{", "Buffer", "buffer", ";", "try", "{", "buffer", "=", "reader", ".", "getPacket", "(", "true", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw...
Read server response packet. @param results result object @throws SQLException if sub-result connection fail @see <a href="https://mariadb.com/kb/en/mariadb/4-server-response-packets/">server response packets</a>
[ "Read", "server", "response", "packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1432-L1471
52,678
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readOkPacket
private void readOkPacket(Buffer buffer, Results results) { buffer.skipByte(); //fieldCount final long updateCount = buffer.getLengthEncodedNumeric(); final long insertId = buffer.getLengthEncodedNumeric(); serverStatus = buffer.readShort(); hasWarnings = (buffer.readShort() > 0); if ((serverS...
java
private void readOkPacket(Buffer buffer, Results results) { buffer.skipByte(); //fieldCount final long updateCount = buffer.getLengthEncodedNumeric(); final long insertId = buffer.getLengthEncodedNumeric(); serverStatus = buffer.readShort(); hasWarnings = (buffer.readShort() > 0); if ((serverS...
[ "private", "void", "readOkPacket", "(", "Buffer", "buffer", ",", "Results", "results", ")", "{", "buffer", ".", "skipByte", "(", ")", ";", "//fieldCount", "final", "long", "updateCount", "=", "buffer", ".", "getLengthEncodedNumeric", "(", ")", ";", "final", ...
Read OK_Packet. @param buffer current buffer @param results result object @see <a href="https://mariadb.com/kb/en/mariadb/ok_packet/">OK_Packet</a>
[ "Read", "OK_Packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1480-L1493
52,679
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readErrorPacket
private SQLException readErrorPacket(Buffer buffer, Results results) { removeHasMoreResults(); this.hasWarnings = false; buffer.skipByte(); final int errorNumber = buffer.readShort(); String message; String sqlState; if (buffer.readByte() == '#') { sqlState = new String(buffer.readRawB...
java
private SQLException readErrorPacket(Buffer buffer, Results results) { removeHasMoreResults(); this.hasWarnings = false; buffer.skipByte(); final int errorNumber = buffer.readShort(); String message; String sqlState; if (buffer.readByte() == '#') { sqlState = new String(buffer.readRawB...
[ "private", "SQLException", "readErrorPacket", "(", "Buffer", "buffer", ",", "Results", "results", ")", "{", "removeHasMoreResults", "(", ")", ";", "this", ".", "hasWarnings", "=", "false", ";", "buffer", ".", "skipByte", "(", ")", ";", "final", "int", "error...
Read ERR_Packet. @param buffer current buffer @param results result object @return SQLException if sub-result connection fail @see <a href="https://mariadb.com/kb/en/mariadb/err_packet/">ERR_Packet</a>
[ "Read", "ERR_Packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1571-L1595
52,680
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readLocalInfilePacket
private void readLocalInfilePacket(Buffer buffer, Results results) throws SQLException { int seq = 2; buffer.getLengthEncodedNumeric(); //field pos String fileName = buffer.readStringNullEnd(StandardCharsets.UTF_8); try { // Server request the local file (LOCAL DATA LOCAL INFILE) // We do a...
java
private void readLocalInfilePacket(Buffer buffer, Results results) throws SQLException { int seq = 2; buffer.getLengthEncodedNumeric(); //field pos String fileName = buffer.readStringNullEnd(StandardCharsets.UTF_8); try { // Server request the local file (LOCAL DATA LOCAL INFILE) // We do a...
[ "private", "void", "readLocalInfilePacket", "(", "Buffer", "buffer", ",", "Results", "results", ")", "throws", "SQLException", "{", "int", "seq", "=", "2", ";", "buffer", ".", "getLengthEncodedNumeric", "(", ")", ";", "//field pos", "String", "fileName", "=", ...
Read Local_infile Packet. @param buffer current buffer @param results result object @throws SQLException if sub-result connection fail @see <a href="https://mariadb.com/kb/en/mariadb/local_infile-packet/">local_infile packet</a>
[ "Read", "Local_infile", "Packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1605-L1678
52,681
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readResultSet
private void readResultSet(Buffer buffer, Results results) throws SQLException { long fieldCount = buffer.getLengthEncodedNumeric(); try { //read columns information's ColumnInformation[] ci = new ColumnInformation[(int) fieldCount]; for (int i = 0; i < fieldCount; i++) { ci[i] = new...
java
private void readResultSet(Buffer buffer, Results results) throws SQLException { long fieldCount = buffer.getLengthEncodedNumeric(); try { //read columns information's ColumnInformation[] ci = new ColumnInformation[(int) fieldCount]; for (int i = 0; i < fieldCount; i++) { ci[i] = new...
[ "private", "void", "readResultSet", "(", "Buffer", "buffer", ",", "Results", "results", ")", "throws", "SQLException", "{", "long", "fieldCount", "=", "buffer", ".", "getLengthEncodedNumeric", "(", ")", ";", "try", "{", "//read columns information's", "ColumnInforma...
Read ResultSet Packet. @param buffer current buffer @param results result object @throws SQLException if sub-result connection fail @see <a href="https://mariadb.com/kb/en/mariadb/resultset/">resultSet packets</a>
[ "Read", "ResultSet", "Packet", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1688-L1735
52,682
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.prolog
public void prolog(long maxRows, boolean hasProxy, MariaDbConnection connection, MariaDbStatement statement) throws SQLException { if (explicitClosed) { throw new SQLException("execute() is called on closed connection"); } //old failover handling if (!hasProxy && shouldReconnectWithout...
java
public void prolog(long maxRows, boolean hasProxy, MariaDbConnection connection, MariaDbStatement statement) throws SQLException { if (explicitClosed) { throw new SQLException("execute() is called on closed connection"); } //old failover handling if (!hasProxy && shouldReconnectWithout...
[ "public", "void", "prolog", "(", "long", "maxRows", ",", "boolean", "hasProxy", ",", "MariaDbConnection", "connection", ",", "MariaDbStatement", "statement", ")", "throws", "SQLException", "{", "if", "(", "explicitClosed", ")", "{", "throw", "new", "SQLException",...
Preparation before command. @param maxRows query max rows @param hasProxy has proxy @param connection current connection @param statement current statement @throws SQLException if any error occur.
[ "Preparation", "before", "command", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1751-L1773
52,683
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.handleIoException
public SQLException handleIoException(Exception initialException) { boolean mustReconnect; boolean driverPreventError = false; if (initialException instanceof MaxAllowedPacketException) { mustReconnect = ((MaxAllowedPacketException) initialException).isMustReconnect(); driverPreventError = !mus...
java
public SQLException handleIoException(Exception initialException) { boolean mustReconnect; boolean driverPreventError = false; if (initialException instanceof MaxAllowedPacketException) { mustReconnect = ((MaxAllowedPacketException) initialException).isMustReconnect(); driverPreventError = !mus...
[ "public", "SQLException", "handleIoException", "(", "Exception", "initialException", ")", "{", "boolean", "mustReconnect", ";", "boolean", "driverPreventError", "=", "false", ";", "if", "(", "initialException", "instanceof", "MaxAllowedPacketException", ")", "{", "mustR...
Handle IoException (reconnect if Exception is due to having send too much data, making server close the connection. <p>There is 3 kind of IOException :</p> <ol> <li> MaxAllowedPacketException : without need of reconnect : thrown when driver don't send packet that would have been too big then error is not a CONNECTION_...
[ "Handle", "IoException", "(", "reconnect", "if", "Exception", "is", "due", "to", "having", "send", "too", "much", "data", "making", "server", "close", "the", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1857-L1897
52,684
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/send/parameters/TimeParameter.java
TimeParameter.writeTo
public void writeTo(final PacketOutputStream pos) throws IOException { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); sdf.setTimeZone(timeZone); String dateString = sdf.format(time); pos.write(QUOTE); pos.write(dateString.getBytes()); int microseconds = (int) (time.getTime() % 1000) *...
java
public void writeTo(final PacketOutputStream pos) throws IOException { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); sdf.setTimeZone(timeZone); String dateString = sdf.format(time); pos.write(QUOTE); pos.write(dateString.getBytes()); int microseconds = (int) (time.getTime() % 1000) *...
[ "public", "void", "writeTo", "(", "final", "PacketOutputStream", "pos", ")", "throws", "IOException", "{", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateFormat", "(", "\"HH:mm:ss\"", ")", ";", "sdf", ".", "setTimeZone", "(", "timeZone", ")", ";", "String", ...
Write Time parameter to outputStream. @param pos the stream to write to
[ "Write", "Time", "parameter", "to", "outputStream", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/TimeParameter.java#L88-L107
52,685
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/Driver.java
Driver.connect
public Connection connect(final String url, final Properties props) throws SQLException { UrlParser urlParser = UrlParser.parse(url, props); if (urlParser == null || urlParser.getHostAddresses() == null) { return null; } else { return MariaDbConnection.newConnection(urlParser, null); } }
java
public Connection connect(final String url, final Properties props) throws SQLException { UrlParser urlParser = UrlParser.parse(url, props); if (urlParser == null || urlParser.getHostAddresses() == null) { return null; } else { return MariaDbConnection.newConnection(urlParser, null); } }
[ "public", "Connection", "connect", "(", "final", "String", "url", ",", "final", "Properties", "props", ")", "throws", "SQLException", "{", "UrlParser", "urlParser", "=", "UrlParser", ".", "parse", "(", "url", ",", "props", ")", ";", "if", "(", "urlParser", ...
Connect to the given connection string. @param url the url to connect to @return a connection @throws SQLException if it is not possible to connect
[ "Connect", "to", "the", "given", "connection", "string", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/Driver.java#L86-L95
52,686
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/Driver.java
Driver.getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { if (url != null) { UrlParser urlParser = UrlParser.parse(url, info); if (urlParser == null || urlParser.getOptions() == null) { return new DriverPropertyInfo[0]; } List<DriverP...
java
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { if (url != null) { UrlParser urlParser = UrlParser.parse(url, info); if (urlParser == null || urlParser.getOptions() == null) { return new DriverPropertyInfo[0]; } List<DriverP...
[ "public", "DriverPropertyInfo", "[", "]", "getPropertyInfo", "(", "String", "url", ",", "Properties", "info", ")", "throws", "SQLException", "{", "if", "(", "url", "!=", "null", ")", "{", "UrlParser", "urlParser", "=", "UrlParser", ".", "parse", "(", "url", ...
Get the property info. @param url the url to get properties for @param info the info props @return something - not implemented @throws SQLException if there is a problem getting the property info
[ "Get", "the", "property", "info", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/Driver.java#L116-L143
52,687
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.initializeConnection
@Override public void initializeConnection() throws SQLException { super.initializeConnection(); try { reconnectFailedConnection(new SearchFilter(true)); } catch (SQLException e) { //initializeConnection failed checkInitialConnection(e); } }
java
@Override public void initializeConnection() throws SQLException { super.initializeConnection(); try { reconnectFailedConnection(new SearchFilter(true)); } catch (SQLException e) { //initializeConnection failed checkInitialConnection(e); } }
[ "@", "Override", "public", "void", "initializeConnection", "(", ")", "throws", "SQLException", "{", "super", ".", "initializeConnection", "(", ")", ";", "try", "{", "reconnectFailedConnection", "(", "new", "SearchFilter", "(", "true", ")", ")", ";", "}", "catc...
Initialize connections. @throws SQLException if a connection error append.
[ "Initialize", "connections", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L166-L175
52,688
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.checkWaitingConnection
public void checkWaitingConnection() throws SQLException { if (isSecondaryHostFail()) { proxy.lock.lock(); try { Protocol waitingProtocol = waitNewSecondaryProtocol.getAndSet(null); if (waitingProtocol != null && pingSecondaryProtocol(waitingProtocol)) { lockAndSwitchSecondary(...
java
public void checkWaitingConnection() throws SQLException { if (isSecondaryHostFail()) { proxy.lock.lock(); try { Protocol waitingProtocol = waitNewSecondaryProtocol.getAndSet(null); if (waitingProtocol != null && pingSecondaryProtocol(waitingProtocol)) { lockAndSwitchSecondary(...
[ "public", "void", "checkWaitingConnection", "(", ")", "throws", "SQLException", "{", "if", "(", "isSecondaryHostFail", "(", ")", ")", "{", "proxy", ".", "lock", ".", "lock", "(", ")", ";", "try", "{", "Protocol", "waitingProtocol", "=", "waitNewSecondaryProtoc...
Verify that there is waiting connection that have to replace failing one. If there is replace failed connection with new one. @throws SQLException if error occur
[ "Verify", "that", "there", "is", "waiting", "connection", "that", "have", "to", "replace", "failing", "one", ".", "If", "there", "is", "replace", "failed", "connection", "with", "new", "one", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L439-L463
52,689
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.reconnectFailedConnection
public void reconnectFailedConnection(SearchFilter searchFilter) throws SQLException { if (!searchFilter.isInitialConnection() && (isExplicitClosed() || (searchFilter.isFineIfFoundOnlyMaster() && !isMasterHostFail()) || searchFilter.isFineIfFoundOnlySlave() && !isSecondaryHostFail())) { ...
java
public void reconnectFailedConnection(SearchFilter searchFilter) throws SQLException { if (!searchFilter.isInitialConnection() && (isExplicitClosed() || (searchFilter.isFineIfFoundOnlyMaster() && !isMasterHostFail()) || searchFilter.isFineIfFoundOnlySlave() && !isSecondaryHostFail())) { ...
[ "public", "void", "reconnectFailedConnection", "(", "SearchFilter", "searchFilter", ")", "throws", "SQLException", "{", "if", "(", "!", "searchFilter", ".", "isInitialConnection", "(", ")", "&&", "(", "isExplicitClosed", "(", ")", "||", "(", "searchFilter", ".", ...
Loop to connect. @throws SQLException if there is any error during reconnection
[ "Loop", "to", "connect", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L471-L544
52,690
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.foundActiveMaster
public void foundActiveMaster(Protocol newMasterProtocol) { if (isMasterHostFail()) { if (isExplicitClosed()) { newMasterProtocol.close(); return; } if (!waitNewMasterProtocol.compareAndSet(null, newMasterProtocol)) { newMasterProtocol.close(); } } else { ne...
java
public void foundActiveMaster(Protocol newMasterProtocol) { if (isMasterHostFail()) { if (isExplicitClosed()) { newMasterProtocol.close(); return; } if (!waitNewMasterProtocol.compareAndSet(null, newMasterProtocol)) { newMasterProtocol.close(); } } else { ne...
[ "public", "void", "foundActiveMaster", "(", "Protocol", "newMasterProtocol", ")", "{", "if", "(", "isMasterHostFail", "(", ")", ")", "{", "if", "(", "isExplicitClosed", "(", ")", ")", "{", "newMasterProtocol", ".", "close", "(", ")", ";", "return", ";", "}...
Method called when a new Master connection is found after a fallback. @param newMasterProtocol the new active connection
[ "Method", "called", "when", "a", "new", "Master", "connection", "is", "found", "after", "a", "fallback", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L551-L564
52,691
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.lockAndSwitchMaster
public void lockAndSwitchMaster(Protocol newMasterProtocol) throws ReconnectDuringTransactionException { if (masterProtocol != null && !masterProtocol.isClosed()) { masterProtocol.close(); } if (!currentReadOnlyAsked || isSecondaryHostFail()) { //actually on a secondary read-only because ...
java
public void lockAndSwitchMaster(Protocol newMasterProtocol) throws ReconnectDuringTransactionException { if (masterProtocol != null && !masterProtocol.isClosed()) { masterProtocol.close(); } if (!currentReadOnlyAsked || isSecondaryHostFail()) { //actually on a secondary read-only because ...
[ "public", "void", "lockAndSwitchMaster", "(", "Protocol", "newMasterProtocol", ")", "throws", "ReconnectDuringTransactionException", "{", "if", "(", "masterProtocol", "!=", "null", "&&", "!", "masterProtocol", ".", "isClosed", "(", ")", ")", "{", "masterProtocol", "...
Use the parameter newMasterProtocol as new current master connection. <i>Lock must be set</i> @param newMasterProtocol new master connection @throws ReconnectDuringTransactionException if there was an active transaction.
[ "Use", "the", "parameter", "newMasterProtocol", "as", "new", "current", "master", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L574-L603
52,692
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.foundActiveSecondary
public void foundActiveSecondary(Protocol newSecondaryProtocol) throws SQLException { if (isSecondaryHostFail()) { if (isExplicitClosed()) { newSecondaryProtocol.close(); return; } if (proxy.lock.tryLock()) { try { lockAndSwitchSecondary(newSecondaryProtocol); ...
java
public void foundActiveSecondary(Protocol newSecondaryProtocol) throws SQLException { if (isSecondaryHostFail()) { if (isExplicitClosed()) { newSecondaryProtocol.close(); return; } if (proxy.lock.tryLock()) { try { lockAndSwitchSecondary(newSecondaryProtocol); ...
[ "public", "void", "foundActiveSecondary", "(", "Protocol", "newSecondaryProtocol", ")", "throws", "SQLException", "{", "if", "(", "isSecondaryHostFail", "(", ")", ")", "{", "if", "(", "isExplicitClosed", "(", ")", ")", "{", "newSecondaryProtocol", ".", "close", ...
Method called when a new secondary connection is found after a fallback. @param newSecondaryProtocol the new active connection @throws SQLException if switch failed
[ "Method", "called", "when", "a", "new", "secondary", "connection", "is", "found", "after", "a", "fallback", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L611-L632
52,693
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.lockAndSwitchSecondary
public void lockAndSwitchSecondary(Protocol newSecondaryProtocol) throws SQLException { if (secondaryProtocol != null && !secondaryProtocol.isClosed()) { secondaryProtocol.close(); } //if asked to be on read only connection, switching to this new connection if (currentReadOnlyAsked || (urlParser....
java
public void lockAndSwitchSecondary(Protocol newSecondaryProtocol) throws SQLException { if (secondaryProtocol != null && !secondaryProtocol.isClosed()) { secondaryProtocol.close(); } //if asked to be on read only connection, switching to this new connection if (currentReadOnlyAsked || (urlParser....
[ "public", "void", "lockAndSwitchSecondary", "(", "Protocol", "newSecondaryProtocol", ")", "throws", "SQLException", "{", "if", "(", "secondaryProtocol", "!=", "null", "&&", "!", "secondaryProtocol", ".", "isClosed", "(", ")", ")", "{", "secondaryProtocol", ".", "c...
Use the parameter newSecondaryProtocol as new current secondary connection. @param newSecondaryProtocol new secondary connection @throws SQLException if an error occur during setting session read-only
[ "Use", "the", "parameter", "newSecondaryProtocol", "as", "new", "current", "secondary", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L640-L665
52,694
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.primaryFail
public HandleErrorResult primaryFail(Method method, Object[] args, boolean killCmd) { boolean alreadyClosed = masterProtocol == null || !masterProtocol.isConnected(); boolean inTransaction = masterProtocol != null && masterProtocol.inTransaction(); //in case of SocketTimeoutException due to having set sock...
java
public HandleErrorResult primaryFail(Method method, Object[] args, boolean killCmd) { boolean alreadyClosed = masterProtocol == null || !masterProtocol.isConnected(); boolean inTransaction = masterProtocol != null && masterProtocol.inTransaction(); //in case of SocketTimeoutException due to having set sock...
[ "public", "HandleErrorResult", "primaryFail", "(", "Method", "method", ",", "Object", "[", "]", "args", ",", "boolean", "killCmd", ")", "{", "boolean", "alreadyClosed", "=", "masterProtocol", "==", "null", "||", "!", "masterProtocol", ".", "isConnected", "(", ...
To handle the newly detected failover on the master connection. @param method the initial called method @param args the initial args @param killCmd is the fail due to a KILL cmd @return an object to indicate if the previous Exception must be thrown, or the object resulting if a failover worked
[ "To", "handle", "the", "newly", "detected", "failover", "on", "the", "master", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L781-L857
52,695
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.reconnect
public void reconnect() throws SQLException { SearchFilter filter; boolean inTransaction = false; if (currentReadOnlyAsked) { filter = new SearchFilter(true, true); } else { inTransaction = masterProtocol != null && masterProtocol.inTransaction(); filter = new SearchFilter(true, urlPar...
java
public void reconnect() throws SQLException { SearchFilter filter; boolean inTransaction = false; if (currentReadOnlyAsked) { filter = new SearchFilter(true, true); } else { inTransaction = masterProtocol != null && masterProtocol.inTransaction(); filter = new SearchFilter(true, urlPar...
[ "public", "void", "reconnect", "(", ")", "throws", "SQLException", "{", "SearchFilter", "filter", ";", "boolean", "inTransaction", "=", "false", ";", "if", "(", "currentReadOnlyAsked", ")", "{", "filter", "=", "new", "SearchFilter", "(", "true", ",", "true", ...
Reconnect failed connection. @throws SQLException if reconnection has failed
[ "Reconnect", "failed", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L876-L891
52,696
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.pingSecondaryProtocol
private boolean pingSecondaryProtocol(Protocol protocol) { try { if (protocol != null && protocol.isConnected() && protocol.ping()) { return true; } } catch (Exception e) { protocol.close(); if (setSecondaryHostFail()) { addToBlacklist(protocol.getHostAddress()); }...
java
private boolean pingSecondaryProtocol(Protocol protocol) { try { if (protocol != null && protocol.isConnected() && protocol.ping()) { return true; } } catch (Exception e) { protocol.close(); if (setSecondaryHostFail()) { addToBlacklist(protocol.getHostAddress()); }...
[ "private", "boolean", "pingSecondaryProtocol", "(", "Protocol", "protocol", ")", "{", "try", "{", "if", "(", "protocol", "!=", "null", "&&", "protocol", ".", "isConnected", "(", ")", "&&", "protocol", ".", "ping", "(", ")", ")", "{", "return", "true", ";...
Ping secondary protocol. ! lock must be set ! @param protocol socket to ping @return true if ping is valid.
[ "Ping", "secondary", "protocol", ".", "!", "lock", "must", "be", "set", "!" ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L899-L912
52,697
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.secondaryFail
public HandleErrorResult secondaryFail(Method method, Object[] args, boolean killCmd) throws Throwable { proxy.lock.lock(); try { if (pingSecondaryProtocol(this.secondaryProtocol)) { return relaunchOperation(method, args); } } finally { proxy.lock.unlock(); } if (!is...
java
public HandleErrorResult secondaryFail(Method method, Object[] args, boolean killCmd) throws Throwable { proxy.lock.lock(); try { if (pingSecondaryProtocol(this.secondaryProtocol)) { return relaunchOperation(method, args); } } finally { proxy.lock.unlock(); } if (!is...
[ "public", "HandleErrorResult", "secondaryFail", "(", "Method", "method", ",", "Object", "[", "]", "args", ",", "boolean", "killCmd", ")", "throws", "Throwable", "{", "proxy", ".", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "pingSecondaryPro...
To handle the newly detected failover on the secondary connection. @param method the initial called method @param args the initial args @param killCmd is fail due to a KILL command @return an object to indicate if the previous Exception must be thrown, or the object resulting if a failover worked @throws Throwable...
[ "To", "handle", "the", "newly", "detected", "failover", "on", "the", "secondary", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L924-L989
52,698
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
MastersSlavesListener.connectedHosts
public List<HostAddress> connectedHosts() { List<HostAddress> usedHost = new ArrayList<>(); if (isMasterHostFail()) { Protocol masterProtocol = waitNewMasterProtocol.get(); if (masterProtocol != null) { usedHost.add(masterProtocol.getHostAddress()); } } else { usedHost.add(m...
java
public List<HostAddress> connectedHosts() { List<HostAddress> usedHost = new ArrayList<>(); if (isMasterHostFail()) { Protocol masterProtocol = waitNewMasterProtocol.get(); if (masterProtocol != null) { usedHost.add(masterProtocol.getHostAddress()); } } else { usedHost.add(m...
[ "public", "List", "<", "HostAddress", ">", "connectedHosts", "(", ")", "{", "List", "<", "HostAddress", ">", "usedHost", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "isMasterHostFail", "(", ")", ")", "{", "Protocol", "masterProtocol", "=", "...
List current connected HostAddress. @return hostAddress List.
[ "List", "current", "connected", "HostAddress", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java#L1072-L1094
52,699
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersSlavesListener.java
AbstractMastersSlavesListener.handleFailover
public HandleErrorResult handleFailover(SQLException qe, Method method, Object[] args, Protocol protocol) throws Throwable { if (isExplicitClosed()) { throw new SQLException("Connection has been closed !"); } //check that failover is due to kill command boolean killCmd = qe != null ...
java
public HandleErrorResult handleFailover(SQLException qe, Method method, Object[] args, Protocol protocol) throws Throwable { if (isExplicitClosed()) { throw new SQLException("Connection has been closed !"); } //check that failover is due to kill command boolean killCmd = qe != null ...
[ "public", "HandleErrorResult", "handleFailover", "(", "SQLException", "qe", ",", "Method", "method", ",", "Object", "[", "]", "args", ",", "Protocol", "protocol", ")", "throws", "Throwable", "{", "if", "(", "isExplicitClosed", "(", ")", ")", "{", "throw", "n...
Handle failover on master or slave connection. @param method called method @param args methods parameters @param protocol current protocol @return HandleErrorResult object to indicate if query has finally been relaunched or exception if not. @throws Throwable if method with parameters doesn't exist
[ "Handle", "failover", "on", "master", "or", "slave", "connection", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersSlavesListener.java#L96-L137