File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,29 @@ try {
104104``` java
105105import com.code.advancedsql.* ;
106106
107+ try {
108+ MySQL mySQL = connect();
109+
110+ // Insert
111+ Insert query = mySQL. table(" users" ). insert();
112+
113+ query. field(" first_name" , " Denzel" );
114+ query. field(" last_name" , " Code" );
115+
116+ int execute = query. execute();
117+
118+ // Print query string and result.
119+ System . out. println(query);
120+ System . out. println(execute);
121+ } catch (SQLException e) {
122+ e. printStackTrace();
123+ }
124+ ```
125+
126+ ** Insert HashMap:**
127+ ``` java
128+ import com.code.advancedsql.* ;
129+
107130try {
108131 MySQL mySQL = connect();
109132
@@ -122,10 +145,33 @@ try {
122145}
123146```
124147
148+
125149** Update:**
126150``` java
127151import com.code.advancedsql.* ;
128152
153+ try {
154+ MySQL mySQL = connect();
155+
156+ // Update
157+ Update query = mySQL. table(" users" ). update(). where(" first_name = ?" , " Denzel" );
158+
159+ query. field(" token" , " Advanced" );
160+
161+ int execute = query. execute();
162+
163+ // Print query string and result.
164+ System . out. println(query);
165+ System . out. println(execute)p
166+ } catch (SQLException e) {
167+ e. printStackTrace();
168+ }
169+ ```
170+
171+ ** Update HashMap:**
172+ ``` java
173+ import com.code.advancedsql.* ;
174+
129175try {
130176 MySQL mySQL = connect();
131177
You can’t perform that action at this time.
0 commit comments