Bulk insert

Lance Andersen lance.andersen at oracle.com
Wed Oct 10 17:31:02 UTC 2018


> On Oct 10, 2018, at 12:34 PM, Mark Rotteveel <mark at lawinegevaar.nl> wrote:
> 
> On 10-10-2018 12:06, Arthur McGibbon wrote:
>> Would it be possible to add bulk insert functionality to the spec?
>> Many drivers already implement this in their own way.  Their procedure is
>> generally to define the column metadata, define some properties about the
>> table (e.g. locking) and then fire a stream at it.
>> For reference...
>> MS SQL: com.microsoft.sqlserver.jdbc.SQLServerBulkCopy
>> PostgreSQL:org.postgresql.copy.CopyManager
>> MySQL:com.mysql.cj.jdbc.StatementImpl#setLocalInfileInputStream
> 
> The problem with this is that these are all specifically native solutions, as in: the file format, configuration options, etc are specific to the underlying database and usually have different tools for that database that support the same options and format.
> 
> Having such a thing for JDBC, in my opinion, would require a common (JDBC-defined) input format, common config, common api, etc, and not just provide a basic entrypoint to get access. If you don't do that, you're not really providing the database-independent API that JDBC tries to be.
> 
> And trying to unify an API that would be suitable to cover the existing options would probably be complex. My guess is that it would likely not gain much traction, because these tools already exist and they map well to equivalent features in other tools for that database system.
> 
> And if you just provide the common denominator or simplest thing possible, then people will probably still end up using the database-specific tooling, as they will likely be richer in features.
> 
> I personally think this is one of those things where it is better to just escape JDBC, and use the database specific tools.
> 
> That said, I assume that if you can come up with a proposal and a workable API, it could be considered by the EG (could you confirm, Lance).

Yes of course this can be revisited.  Years ago, this was brought up by DataDirect/Progress when they were working on prototyping their BulkLoad API, https://media.datadirect.com/download/docs/jdbc/alljdbc/help.html#page/jdbcconnect%2Fusing-datadirect-bulk-load.html%23wwID0EHAPM <https://media.datadirect.com/download/docs/jdbc/alljdbc/help.html#page/jdbcconnect/using-datadirect-bulk-load.html#wwID0EHAPM>.  This was on the list to revisit but we never got back to it.

Brody or Mark B might have thoughts on the challenges they have encountered with their API and databases they support.
> 
> Mark
> -- 
> Mark Rotteveel

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>





More information about the jdbc-spec-discuss mailing list