Load database contents into a region or store region contents to a database table. There are 2 distinctive commands.

Initialize database connection. Remember to add the JDBC driver jar/class in CLASSPATH before starting gfsh.

gfsh:/>db -driver com.mysql.jdbc.Driver -url jdbc:mysql://localhost:3306/ShoppingDB -u mysql -p mysql     

Database connected.

Transfer Data to/from Database.

gfsh:/>db /Orders out Orders                                                                              

db out complete
   From (region): /Orders
   To (database): Orders
       Row count: 3
  elapsed (msec): 75

The names of the columns in table in database must match the field names of the object to be exported. Execute "db -?" for more options.

Note: If the region is a partitioned region then the 'out' option retrieves data only from the local dataset of the connected server due to the potentially large size of the partitioned region.