@@ -501,6 +501,40 @@ static DatetimeType valueOfString(String value) throws SQLServerException {
501501 }
502502}
503503
504+ enum VectorTypeSupport {
505+ OFF ("off" ),
506+ V1 ("v1" ),
507+ V2 ("v2" );
508+
509+ private final String type ;
510+
511+ VectorTypeSupport (String type ) {
512+ this .type = type ;
513+ }
514+
515+ @ Override
516+ public String toString () {
517+ return type ;
518+ }
519+
520+ static VectorTypeSupport valueOfString (String value ) throws SQLServerException {
521+ VectorTypeSupport vectorType ;
522+ assert value != null ;
523+ if (value .equalsIgnoreCase (VectorTypeSupport .OFF .toString ())) {
524+ vectorType = VectorTypeSupport .OFF ;
525+ } else if (value .equalsIgnoreCase (VectorTypeSupport .V1 .toString ())) {
526+ vectorType = VectorTypeSupport .V1 ;
527+ } else if (value .equalsIgnoreCase (VectorTypeSupport .V2 .toString ())) {
528+ vectorType = VectorTypeSupport .V2 ;
529+ } else {
530+ MessageFormat form = new MessageFormat (SQLServerException .getErrString ("R_invalidVectorTypeSupport" ));
531+ Object [] msgArgs = {"vectorTypeSupport" , value };
532+ throw new SQLServerException (null , form .format (msgArgs ), null , 0 , false );
533+ }
534+ return vectorType ;
535+ }
536+ }
537+
504538
505539enum SQLServerDriverObjectProperty {
506540 GSS_CREDENTIAL ("gsscredential" , null ),
@@ -615,7 +649,7 @@ enum SQLServerDriverStringProperty {
615649 RETRY_CONN ("retryConn" , "" ),
616650 QUOTED_IDENTIFIER ("quotedIdentifier" , OnOffOption .ON .toString ()),
617651 CONCAT_NULL_YIELDS_NULL ("concatNullYieldsNull" , OnOffOption .ON .toString ()),
618- VECTOR_TYPE_SUPPORT ("vectorTypeSupport" , "v1" );
652+ VECTOR_TYPE_SUPPORT ("vectorTypeSupport" , VectorTypeSupport . V1 . toString () );
619653
620654 private final String name ;
621655 private final String defaultValue ;
@@ -1014,7 +1048,8 @@ public final class SQLServerDriver implements java.sql.Driver {
10141048 new SQLServerDriverPropertyInfo (SQLServerDriverBooleanProperty .ENABLE_BULK_COPY_CACHE .toString (),
10151049 Boolean .toString (SQLServerDriverBooleanProperty .ENABLE_BULK_COPY_CACHE .getDefaultValue ()),false , TRUE_FALSE ),
10161050 new SQLServerDriverPropertyInfo (SQLServerDriverStringProperty .VECTOR_TYPE_SUPPORT .toString (),
1017- SQLServerDriverStringProperty .VECTOR_TYPE_SUPPORT .getDefaultValue (), false , new String [] {"off" , "v1" , "v2" }),
1051+ SQLServerDriverStringProperty .VECTOR_TYPE_SUPPORT .getDefaultValue (), false ,
1052+ new String [] {VectorTypeSupport .OFF .toString (), VectorTypeSupport .V1 .toString (), VectorTypeSupport .V2 .toString ()}),
10181053 new SQLServerDriverPropertyInfo (SQLServerDriverStringProperty .MSI_CLIENT_ID .toString (),
10191054 SQLServerDriverStringProperty .MSI_CLIENT_ID .getDefaultValue (), false , null ),
10201055 new SQLServerDriverPropertyInfo (SQLServerDriverStringProperty .KEY_VAULT_PROVIDER_CLIENT_ID .toString (),
0 commit comments