1. Add necessary packages to lib. The import result is as follows:
Only include necessary packages. Additional requirements are required.
2. Upload All java files to the src directory.
3. Put all the poing files (XXX. hbm. xml) to the src directory.
4. Modify and configure the database
jdbc.driverClassName=com..jdbc..url=jdbc::jdbc.username=.password=sk
The database address is sqld.duapp.com, the port is 4050, And the dbname is"Cloud Environment Management> Service Management> MySQL (database)The name of the database created in the application. the user name is the API Key of the application and the password is the Secret Key.
5. modify all locations used to the Database Name
For example, in the POJO ing file (XXX. hbm. xml)
The values in must be changed to the database name specified by the BAE. Otherwise, the exception org. hibernate. exception. SQLGrammarException: cocould not execute query will occur.
6. Modify and add spring:
contextConfigLocation classpath:applicationContext.xml org.springframework.web.context.ContextLoaderListener
ContextConfigLocation is used to set the location of applicationContext. xml. When the server is started, it will find the/WEB_INF/applicationContext. xml file. After the server is started, it will find applicationContext. xml in the classes directory.
Note: It is useless to place anything under the/WEB_INF/classes directory in the project code. BAE will compile the files under the src directory and copy them to the directory where the real application runs.
7. Configuration:
true
Where
true
This parameter is used to start distributed sessions. If this parameter is not set, the Session function is disabled by default. If the Session is used, an error is reported.