Hi there,
I have a created sth like an ebook reader for html books. I have a highlight tool and a textfield to keep some notes for each page. When the user goes from one page to there other I do connect and disconnect to the database 4 times. One to save the highlights of the page, one to save the notes and another to load these in characteristics to my new page.
Acutally I do sth like this:
//Save the highlights and the notes of the current page
no.saveNotes();
hi.saveHighToDB();
// Load and display specified page.
ViewClass.getEditorPane().setPage(pageUrl);
//Load the highlights and the notes of the new page
hi.loadingMakeHighlight();
no.LoadNotes();
This make my program very slow. It takes along time to load the new page. The whole program, database and book run locally so it should be faster 'cause afterwards I want to put in the book and the database on a server.
Is there a way to make less connections or sth to make it faster??
Is it better/faster to make 1 connection to save the 2 things and 1 to load them? The saveNotes() and LoadNotes() are in the same class and the saveHighToDB() and loadingMakeHighlight() are in a different one. How I can solve this?
Thanks in advance