Skip to content

Commit 342819b

Browse files
authored
Update README.md
1 parent a294bcf commit 342819b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Example Code:
99

1010
```java
1111
import sync.db.mysql.*; //Import the MySQLDBSync.jar file into your project's lib folder first.
12+
import java.util.Scanner;
1213

1314
public class Test{
1415

@@ -48,9 +49,11 @@ public class Test{
4849
dbSyncAgent.connect(); //Establish connection to server and client databases.
4950
dbSyncAgent.sync(); //Call this when synchronizing for first time, even if live synchronization is required. If the latter is the case, call the method for live synchronization immediately after this.
5051
dbSyncAgent.liveSync(); //Activates live sync. Make sure syncInterval() method has been used or the sync interval property was set while building the DBSyncObject. So not use this method if the client server has been idle for a while or is starting for the first time, especially if the server receives a lot of entires within this period. In this case, call the sync() function method, followed by this method.
52+
5153
System.out.println("Enter a command:");
5254
Scanner scanner = new Scanner(System.in);
5355
String s = scanner.next(); //The synchronization happens in a new Thread. This main thread is free to receive commands. Use your standard input to enter the command 'end' to end the synchronization. This will end all synchronization activities safely.
56+
5457
if(s.equals("end"){
5558
dbAgent.stopSync(); //Call this method to stop the synchronization safely.
5659
dbAgent.disconnect(); //Call this method after the stopSync() method has been called. Do not call this method without calling the stopSync() method.

0 commit comments

Comments
 (0)