While this question was about SQL Server 2008, and while it really wasn't possible to pass table valued parameters at the time, it is now. This is documented here in the JDBC driver manual. For example, it could be done like this:
SQLServerDataTable table = new SQLServerDataTable();
table.addColumnMetadata("i" ,java.sql.Types.INTEGER);
table.addRow(1);
table.addRow(2);
table.addRow(3);
table.addRow(4);
try (SQLServerPreparedStatement stmt=
(SQLServerPreparedStatement) connection.prepareStatement(
"SELECT * FROM some_table_valued_function(?)")) {
// Magic here:
stmt.setStructured(1, "dbo.numbers", table);
try (ResultSet rs = stmt.executeQuery()) {
...
}
}
I've also recently blogged about this here.