milvus-sdk-java icon indicating copy to clipboard operation
milvus-sdk-java copied to clipboard

Is there a method to switch to another database after instantiating the client in the Java SDK?

Open alpha2wang opened this issue 1 year ago • 3 comments

Is there a method to switch to another database after instantiating the client in the Java SDK?

alpha2wang avatar Jul 23 '24 12:07 alpha2wang

The address of the database is specified when you declaring a MilvusClient, and this address cannot be changed. If you want to connect to another database, declare a new MilvusClient by its address.

yhmo avatar Jul 29 '24 03:07 yhmo

The address of the database is specified when you declaring a MilvusClient, and this address cannot be changed. If you want to connect to another database, declare a new MilvusClient by its address.

@yhmo @alpha2wang I think we need a "use database xxx"

xiaofan-luan avatar Jul 31 '24 08:07 xiaofan-luan

If the "database" is db of milvus, MilvusClientV2 has the interface useDatabase(), which can switch to another database. The V1 MilvusClient doesn't have the ability.

But if the "database" is "another milvus instance", then you have to create another MilvusClient to connect.

yhmo avatar Jul 31 '24 10:07 yhmo