Thursday, June 21, 2018

[google-cloud-sql-discuss] Re: trying storage with JDBC a string digits into Binary cell with no luck .. any suggestions?

 Hey , let me try to explain the whole scenario  for better understanding.

I have from the user his google plus ID that is huge string something like "13121121111111211233322421"
now i want to convert this huge string into a binary within my SQL table for faster indexing. 
so I made a SQL cell using Binary (21).

now I have try to execute this query :

"select * from connections where connections.left_user = ? and connections.right_user =? ";

the ? are strings with the id.

* NOT SPECIFIED *

now I use JDBC and I try to add to his properties : 

props.setProperty("binaryTransfer","true");

and I try all the combinations I found to try to use the string as binary within the :

preparedStatement.setString(1, .strLeft); // use bytep[[ , binaryStream , everything //

preparedStatement.setString(1, strRight);

resultSet = preparedStatement.executeQuery();

but when I check the log I see those messages about the two values that they are not :* NOT SPECIFIED *

now I change my SQL table left & right back to   'varchar(255)' but I really like to know how to use the binary instead.

thanks alot.













--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/fbdd02ad-bee0-429c-8916-c692fa1e8d05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment