Skip to content

Commit dfc1646

Browse files
authored
Update README.md
1 parent aecb0af commit dfc1646

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ This library uses 'timestamps' occuring in both the server and the client databa
88
Example Code:
99

1010
```java
11-
import sync.db.mysql.*; //Import the MySQLDBSync.jar file into your project's lib folder first
11+
import sync.db.mysql.*; //Import the MySQLDBSync.jar file into your project's lib folder first.
1212

1313
public class Test{
1414

1515
public static void main(String args[]){
1616

17-
DBMap dbMap = new DBMap(); //Creates a new DBMap object. The DBMap objects lets you create a mapping between source and destination MySQL Server database names, table names and attribute names
18-
17+
DBMap dbMap = new DBMap(); //Creates a new DBMap object. The DBMap objects lets you create a mapping between source and destination MySQL Server table names and attribute names of these tables.
18+
TableMap tableMap = new TableMap(); //Creates a new TableMap object. The TableMap objects lets you create a mapping between table names and attribute names withing these tables. This will become a part of the DBMap object we created earlier.
19+
tableMap.addAttributeMap(new AttributeMap("name","fullname",AttributeType.STRING)); //Creates a new AttributeMap object that maps an attribute name between these tables. Here, the source table has an attribute called 'name', which is mapped to the attribute called 'fullname' in the destination table. The third parameter, AttributeType.STRING tells what type of attribute is being mapped; for e.g. varchar, char, timestamp, etc. are of type AttributeType.STRING whereas float, int, double etc. are of type AttributeType.NUMERICAL.
20+
tableMap.addAttributeMap(new AttributeMap("servertime","servertime",AttributeType.STRING));
1921
}
2022
}
2123
```

0 commit comments

Comments
 (0)