Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

ClientPreparedQueryBindings setInt method convert int directly to byte array (1 reply)

$
0
0
ClientPreparedQueryBindings
setInt method do following things

@Override
public void setInt(int parameterIndex, int x) {
setValue(parameterIndex, String.valueOf(x), MysqlType.INT);
}

public synchronized final void setValue(int paramIndex, String val, MysqlType type) {
byte[] parameterAsBytes = StringUtils.getBytes(val, this.charEncoding);
setValue(paramIndex, parameterAsBytes, type);
}

step1. convert int to String
step2. convert String to ascii byte array

My question is could we convert int directly to byte array?

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>