If we are assigning this value as create,it will create table in database automatically when we run the application.So no need to write sql query for table creation.But when you are running the example second times you need to change this attribute to "update" otherwise hibernate will throw exception. If you click the button Test you can verify that the connection is working. Here, we connect to the database hours on the server atviecrm1, using the previously created MySQL user oracle (the password is also oracle).The ODBC data source name is test. Note :- In the above configuration file we mentioned create. Setup the ODBC data source to your MySQL database. Note :-If your database column name and persistence class variable is same then no need to specify column property in. In this mapping file, Student class is linked with STUDENT table in the database, and next is the id element, means in the database table what column we need to take as primary key column, that property name we need to give here,I have been given my property name id which will mapped with ID column in the table, name is mapped with STUDENT_NAME column ,degree is mapped with DEGREE column of the STUDENT table and so on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |