SQL INSERT INTO ... a real table, not html table

Using SimpleJDBCConnectionPool, I need to do an SQL INSERT statement…




INSERT INTO table_name (column1,column2,column3,…)
VALUES (value1,value2,value3,…);


Done this a million times with JDBC, assembling a string that is the SQL INSERT. Like this example from a JAVA command line project using JDBC connecting to MS SQL Server.



stmtInsert = conSQLServer.createStatement();
stmtInsert.execute(sSQLInsert); // Do insert.

Not seening an equivalent using Vaadin object model.

The data I need to insert is totally disconnected, there is no binding to any UI type object.

What I am working with is the following code snippet from the MODEL. Reading the Vaadin docs, I am seeing doing something like the following, but am a little stumped. Again, a simple blast of records into a table. The table is small, just storing foreign keys and forming a many-to-many relationship.



//…This is broken and needs to work :slight_smile:
public void WriteAudit(String parm_SFDC_ID, String parm_Audit_ID){
System.out.println(" Audit Salesforce " + parm_SFDC_ID + " Audit " + parm_Audit_ID);
RowId ri = new RowId();
RowItem riWrite = new RowItem(SQLContainer, ri);
qryOppoUpdated.storeRowImmediately(null);
}

Answered my own question.

[size=1]


conn = Pool.reserveConnection();

[/size]

Hands me a connection and I can use about any JDBC statement I want.

Just be sure to release the connection :slight_smile:



Pool.releaseConnection(conn);