JDBC Insert with Params

269 views
Skip to first unread message

Guru Prasad

unread,
Jan 14, 2016, 3:51:23 AM1/14/16
to vert.x
I want to insert a new row into MySQL using the Vert.x JDBCClient. The row contains several differnt data types which includes DateTime, Varchar, double, etc. So I want to perform an insert operation using params. But the Vert.x's SQLConnection object doesn't provide an execute() method which accepts params.

Any suggestions how this can be achieved?

Jozef Ševčík

unread,
Jan 15, 2016, 8:59:34 AM1/15/16
to vert.x
Use updateWithParams() methods.
connection.updateWithParams("insert into x values(?)", new JsonArray().add(1), null);

Mumuney Abdlquadri

unread,
Jan 15, 2016, 9:02:28 AM1/15/16
to ve...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/522eb1f0-e129-4b29-a251-35b307576494%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mumuney Abdlquadri

unread,
Jan 15, 2016, 9:03:55 AM1/15/16
to ve...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages