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 {
104
104
``` java
105
105
import com.code.advancedsql.* ;
106
106
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
+
107
130
try {
108
131
MySQL mySQL = connect();
109
132
@@ -122,10 +145,33 @@ try {
122
145
}
123
146
```
124
147
148
+
125
149
** Update:**
126
150
``` java
127
151
import com.code.advancedsql.* ;
128
152
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
+
129
175
try {
130
176
MySQL mySQL = connect();
131
177
You can’t perform that action at this time.
0 commit comments