  We consider a classical harmonic driving field as the energy charger for the
quantum batteries, which consist of an ensemble of two-level atoms. The maximum
stored energy and the final state are derived analytically with the optimal
driving frequency. At the end of charging procedure, each of atoms is in the
upper state and the batteries are charging completely, which exhibits a
substantial improvement over the square-wave charger. Involving the interatomic
correlations, we find that the repulsive couplings show an advantage in
achieving fully charging with shorter charging period. However, the attractive
interactions induce a negative effects on the charging, since the ground state
undergoes a quantum phase transition from a separable state to a doubly
degenerate state. Approaching to the phase transition regime, the maximum
stored energy drops sharply from the fully-charging value. The phase transition
favors to suppress the charging of the battery and prevents the final state to
be a separable state due to quantum fluctuations in our quantum batteries.
