Does sybase 15 support bcp api in java?

Once upon a time, I realized that bcp is just a small C program that calls the special sybase client api bit for bulk data moving to the database. These are cheats and thefts and miss control limits in the name of speed. Great, I'm all for it. In sybase 12, I noticed that api was open in the C client library, but not in java.

I searched, but I did not find anything that says that they have not yet implemented it in the sybase 15 java client library. Does anyone know if this is available or not in sybase 15?

+6
sybase bcp sybase-bcp
source share
4 answers

I disagree with your comments in Java using the BCP api. Although I agree with the limitations of Java and ODBC / JDBC, this does not mean that there are no benefits to using the Java BCP api. We have a system with a lot of Java and its not practical or very effective ability to lay out from Java and run the BCP command-line utility.

Running the command line utility does not give very good error reports and blocking attempts. It also requires writing data to a file, which will increase the number of operations and slow down the whole process. Sometimes we can’t even write a file in the form of a grid that does not have a file system, and tmp is too small.

In terms of speed, JBCP is slower than its own api, however it is acceptable and, of course, faster than calling repeated paste commands.

Mwillett (author of JBCP)

+3
source share

I do not think this may be a problem when setting this operation to the JDBC specification.

I see a JBCP project at SourceForge but have no experience with it.

+1
source share

The answer is NO.

But why on Earth would you like to move a lot of data from Java to the server? (1) Java is not intended for this, so it will be very slow. (2) The native bcp or C + bcp or perl + bcp, or any shell + bcp command will circle around it and force it out anyway. It is like wanting to run bcp through ODBC or JDBC.

We need to move away from Maslow Hammer and use the right tool for the job.


More details by replying to comments:

  • A regular PROGRAM that connects to the ASE server (Client-Server style) uses the provided Open Client Library; it is native and efficiently moves TDS packets. The connection is a universal garden hose per inch. PROGRAMS written in C, C ++, COBOL, Perl and PowerBuilder use this transport.

  • ODBC (and therefore JDBC because it is built on top of ODBC) is an easy way to connect to a server using a single millimeter hose. Although this is quite suitable for tasks such as using Excel to draw diagrams directly from ASE tables, where the data transfer speed is not relevant; it is rather inadequate for moving data of any substantial volume, for ordinary access to applications on a data server (except when the "programmer" does not know what is available [1]).
    .
    Java does not have [1] and is limited to this transport [2].

  • bcp is a PROGRAM utility (exists by itself), supplied by the provider, which is more closely connected to the server. This is not a "special bit of the API client." There is no "lie and deception", all restrictions are directed by the database administrator performing the task. The connection is a two-piece fire hose that is not publicly available. It is designed to move large amounts of data with speed. If it is used on the same host as the server, since the hoses are not mesh through the network, it moves the data even faster.

  • Much later, the provider provided bcp features in the form of a library (API in your conditions), so it can be called from any reasonably thought out compiler. C, C ++, COBOL and Perl are such, and produce PROGRAMS, and therefore provide access to this library directly from your code. The connection is the same two-part fire hose, but due to additional layers it works at the maximum speed of a two-inch fire hose.

(Pay attention to readers who expect this to be a complete list: There are two other parameters that I have not detailed here, because they are server-server and are not related to this stream).

Since Java PROGRAMS is currently limited to a one-millimeter connection to the ASE server, there is no use in providing a bcp API for Java (you only have two and a half inches of fire hose hidden over the network with a FLOW of one millimeter), this is an absurd venture . There is a reason that, in spite of the millions that many organizations poured into Java, during a rather long progression, none of them spent money on creating a fire department that moves droplets and droplets.

You cannot get greyhound speed from a dachshund, there is no use giving her a treadmill workout. You can stop the whispering promises in your ear.

Secondly, Java cannot efficiently process large (source) data sets; it was not designed for this. Therefore, even if the JDBC strangulation was canceled (for example, the native Open Client library was implemented), it still cannot move data as fast as C, C ++, COBOL, Perl, PB; it will move data in a trickle (a quarter of an inch?) in one inch hose. Therefore, even then it would be absurd to provide bcp features for the Java library; this would be advisable if and when Java (which was designed with other priorities in mind) was assigned with great data transfer capability.

It can help get out of your Java, Java, and nothing but thinking Java, and use the "Right Tool" (PROGRAM) for the job. If you are a Java programmer, then at least you need to familiarize yourself with the capabilities and limitations of your programming language and available libraries. The initial question demonstrates complete ignorance of this, so I had to provide it in my revised post.

Unlimited Java programmers, think about where the big data source is; minimize data transmission over networks; think about which PROGRAMS have already been written and which can be used (as opposed to writing them separately from the rest of the planet); and use them.

Finally, for understanding, even if you got bcp in some library and implemented it when you host the “program” in the real world, any reasonable database administrator will reject it due to transferring data rates, and use bcp instead with your fire hose.

+1
source share

If you don't mind that your Java program is no longer portable, you can link it to any C library through JNI. It is preferable to rewrite your application or invoke a separate task for BCP for data

I assume that you do not want to rewrite your entire application in C ++; -)

+1
source share

All Articles