Can someone please tell me tha code for saving items to an already connected database
I am not sure what you mean by saving really, it's either create, insert, update, and delete. If you are trying to insert data into a database table follow these steps.
1. Try catch block
2. Register driver / Establish connection to database
3. Connection con = DriverManager.get connection(user,pass);
4. Create statement
Statement stmt = con.CreateStatement();
5. String SQL = "sql syntax goes here;";
6. ResultSet rs = stmt.executeQuery(SQL);
Establish a connection to the database and assign it to a variable, eg Connection c;, from that get a statement Statement stmt = c.create statement();, then use stmt.executeUpdate(updateString); where updateString is the SQL syntax used for retrieving the data, such as "UPDATE yourtable SET thiscolumn = thisvalue WHERE thatcolumn = thatvalue" Afterwards surround the whole thing with a try block then add a finally block after within which you do c.close();. Closing the connection ensures two updates don't try occur simultaneously and create conflicts.
Abstraction means hiding implementation of some code which is not required or important to client . Interfaces are best example of abstraction
void methodName(); 》abstract method
Encapsulation means hiding class members and accessing them via public setters and getters methods
Create an object of prepared statement by supplying the query and then exexute the prepared statement and then do not foget to commit the connection object.
commit statment in oracle