The invention discloses a traditional Chinese medicine for treating gastric ulcer. The traditional Chinese medicine is prepared from the following traditional Chinese medicinal materials in parts by weight: 29-41 parts of watermeion peel, 22-36 parts of radix berberidis, 20-34 parts of fructus gleditsiae sinensis, 16-28 parts of silkworm larva, 13-25 parts of sophora flowers, 11-18 parts of folium isatidis and 2-9 parts of szechwan Chinaberry fruits. The traditional Chinese medicine preparation disclosed by the invention has the efficacies of calming the liver, relieving pain, regulating qi, tonifying the spleen, tonifying the spleen, the lung and the kidneys, strengthening the middle warmer, benefiting vital energy, stopping bleeding and arresting vomiting, and is mainly used for treating spleen and stomach disorder and weakness of the spleen and the stomach. The targets of checking diarrhea, diminishing inflammation, relieving spasm and pain, improving local blood circulation and metabolism, strengthening intestinal immune function and promoting ulcer healing can be achieved. The traditional Chinese medicine is simple and convenient in preparation technology, small in toxic or side effect, convenient to dose, easy to manufacture, low in cost, short in curing time and free of relapse after curing, and can be through to the lesion.