arrays - How to convert a Java byte[] into a java.lang.Object[] (to pass to callableStatement() in JDBC -
i'm trying convert byte[] java.lang.object[]. it's reverse problem discussed here, , related (but different from) question on callablestatements in scala.
bottom line: have byte[] represents binary file. need pass jdbc callablestatement.setobject() using createarrayof("byte", objectarray) can't figure out how transform byte[] object[].
this have now... getbytes() function returns byte[] generates compiler error, of course:
callablestatement.setobject(index, callablestatement.getconnection().createarrayof("byte", getbytes())); unfortunately, generates compiler error:
sentimentdao.java:111: error: incompatible types: byte[] cannot converted object[]
also i'm not entirely sure first argument createarrayof() should byte (if know, please add answer too).
thank – the appreciated!
Comments
Post a Comment