vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| All, the manuals for the 5.5 and 6.0 drivers claim: << jConnect is the Sybase high-performance JDBC driver. jConnect is both: * A net-protocol/all-Java driver within a three-tier environment, and * A native-protocol/all-Java driver within a two-tier environment. >> Assuming I have the client installed, how do I invoke the type 2 driver? tia tk |
| |||
| On Thu, 25 Aug 2005 09:06:52 -0700, darthmind wrote: > All, > > the manuals for the 5.5 and 6.0 drivers claim: > > << > jConnect is the Sybase high-performance JDBC driver. jConnect is both: > > * A net-protocol/all-Java driver within a three-tier environment, > and > * A native-protocol/all-Java driver within a two-tier environment. >>> >>> > Assuming I have the client installed, how do I invoke the type 2 driver? You need to have the right classpath, and then do something like: public class PayInsert { static SybDriver _sybDriver = null; static Connection _con = null; public PayInsert() { try { _sybDriver = (SybDriver)Class.forName( "com.sybase.jdbc2.jdbc.SybDriver").newInstance (); DriverManager.registerDriver((Driver)_sybDriver); Properties props = new Properties(); props.put("user", "junk"); props.put("password", "pay1214"); _con = DriverManager.getConnection("jdbc:sybase:Tds:twins :5010/payment_db?JCONNECT_VERSION=6", props); } catch (java.lang.Exception ex) { // Got some other type of exception. Dump it. ex.printStackTrace (); } } You get the idea... Michael -- Michael Peppler [TeamSybase] mpeppler@peppler.org - http://www.peppler.org/ Sybase DBA/Developer Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
| |||
| Your suggestion is to specify the JCONNECT_VERSION=6 connection property. I see nothing related to the type 2 driver in the description - how do you know it will use the Type 2 driver? VERSION_6 * jConnect requests support for the date and time SQL datatypes from the server. This request is ignored by servers other than Adaptive Server version 12.5.1 and later. * jConnect requests support for the unichar and univarchar datatypes from the server. This request is ignored by servers other than Adaptive Server 12.5 and later. * jConnect requests support for wide tables from the server. This request is ignored by servers other than Adaptive Server 12.5 and later. * The default value of the LANGUAGE connection property is null. * If the CHARSET connection property does not specify a character set, jConnect uses the database's default character set.The default value for CHARSET_CONVERTER is the PureConverter class. * By default, Statement.cancel( ) cancels only the Statement object it is invoked on. * JDBC 2.0 methods can be used to store and retrieve Java objects as column data. For jConnect version 5.x, the default is VERSION_5. For additional information, see the comments for VERSION_4. For additional information for date and time datatypes, see "Using Date and Time datatypes". For more information on wide tables, see "Wide table support for Adaptive Server version 12.5 and later". For more information on unichar and univarchar datatypes and Unicode, see "Using jConnect to pass Unicode data". |
| |||
| darthmind@gmail.com wrote: > Your suggestion is to specify the JCONNECT_VERSION=6 connection > property. I see nothing related to the type 2 driver in the description > - how do you know it will use the Type 2 driver? Hi. I'll chip in here. There seems to be a terminology issue. "Type-2" means the driver uses native DBMS vendor libraries on the local machine (CTLib in the case of Sybase) to do the real DBMS communication. The sybase driver is not a type-2 driver. It is a type-4 driver: it is all-Java and connects directly to the DBMS at the socket level, and speaks the DBMS's client protocol. A type-3 driver is also all-Java, but it connects indirectly. It connects to a middle process, which may be Java or anything else, and can be running anywhere, and it is this middle process which connects to the DBMS. The only thing the Sybase JDBC driver knows about what it's connecting to, is a machine name and a port number. If you know that represents a DBMS, good, but if it might be a gateway/middle tier between the driver and DBMS, the driver can't know that. The gateway's job is to be transparent. Joe Weinstein at BEA Systems > > VERSION_6 > > * jConnect requests support for the date and time SQL datatypes > from the server. This request is ignored by servers other than Adaptive > Server version 12.5.1 and later. > * jConnect requests support for the unichar and univarchar > datatypes from the server. This request is ignored by servers other > than Adaptive Server 12.5 and later. > * jConnect requests support for wide tables from the server. This > request is ignored by servers other than Adaptive Server 12.5 and > later. > * The default value of the LANGUAGE connection property is null. > * If the CHARSET connection property does not specify a character > set, jConnect uses the database's default character set.The default > value for CHARSET_CONVERTER is the PureConverter class. > * By default, Statement.cancel( ) cancels only the Statement object > it is invoked on. > * JDBC 2.0 methods can be used to store and retrieve Java objects > as column data. > > For jConnect version 5.x, the default is VERSION_5. > > For additional information, see the comments for VERSION_4. > > For additional information for date and time datatypes, see "Using Date > and Time datatypes". > > For more information on wide tables, see "Wide table support for > Adaptive Server version 12.5 and later". > > For more information on unichar and univarchar datatypes and Unicode, > see "Using jConnect to pass Unicode data". > |
| |||
| Going back to what I originally posted: =<<<< jConnect is the Sybase high-performance JDBC driver. jConnect is both: * A net-protocol/all-Java driver within a three-tier environment, and * A native-protocol/all-Java driver within a two-tier environment. =>>>> Are you saying we are looking at a type-3 and type-4 driver only? tia tk Joe Weinstein wrote: > darthmind@gmail.com wrote: > > > Your suggestion is to specify the JCONNECT_VERSION=6 connection > > property. I see nothing related to the type 2 driver in the description > > - how do you know it will use the Type 2 driver? > > Hi. I'll chip in here. There seems to be a terminology issue. > "Type-2" means the driver uses native DBMS vendor libraries on > the local machine (CTLib in the case of Sybase) to do the real > DBMS communication. The sybase driver is not a type-2 driver. > It is a type-4 driver: it is all-Java and connects directly to > the DBMS at the socket level, and speaks the DBMS's client > protocol. > A type-3 driver is also all-Java, but it connects indirectly. > It connects to a middle process, which may be Java or anything else, > and can be running anywhere, and it is this middle process which > connects to the DBMS. > The only thing the Sybase JDBC driver knows about what it's > connecting to, is a machine name and a port number. If you know > that represents a DBMS, good, but if it might be a gateway/middle tier > between the driver and DBMS, the driver can't know that. The > gateway's job is to be transparent. > Joe Weinstein at BEA Systems > > > |
| ||||
| darthmind@gmail.com wrote: > Going back to what I originally posted: > > =<<<< > jConnect is the Sybase high-performance JDBC driver. jConnect is both: > > * A net-protocol/all-Java driver within a three-tier environment, > and > * A native-protocol/all-Java driver within a two-tier environment. > =>>>> > > Are you saying we are looking at a type-3 and type-4 driver only? Yes. I guess I am saying that the Sybase documentation means (only) what it says. It doesn't say anything about it's being a type-2 driver. "Type-2" doesn't equal "two-tier". All the documentation says is what protocol(s) the driver knows. I am saying that it always is all-Java and always opens a raw Java socket to whatever machine and port name you give it in your URL and properties. It is likely that whatever they connect to, sends a login response packet telling the driver whether to use the DBMS native protocol (TDS) or something else for whatever sybase middle-tiers Sybase provides. Joe Weinstein at BEA > > tia > > tk > > Joe Weinstein wrote: > >>darthmind@gmail.com wrote: >> >> >>>Your suggestion is to specify the JCONNECT_VERSION=6 connection >>>property. I see nothing related to the type 2 driver in the description >>>- how do you know it will use the Type 2 driver? >> >>Hi. I'll chip in here. There seems to be a terminology issue. >>"Type-2" means the driver uses native DBMS vendor libraries on >>the local machine (CTLib in the case of Sybase) to do the real >>DBMS communication. The sybase driver is not a type-2 driver. >>It is a type-4 driver: it is all-Java and connects directly to >>the DBMS at the socket level, and speaks the DBMS's client >>protocol. >> A type-3 driver is also all-Java, but it connects indirectly. >>It connects to a middle process, which may be Java or anything else, >>and can be running anywhere, and it is this middle process which >>connects to the DBMS. >> The only thing the Sybase JDBC driver knows about what it's >>connecting to, is a machine name and a port number. If you know >>that represents a DBMS, good, but if it might be a gateway/middle tier >>between the driver and DBMS, the driver can't know that. The >>gateway's job is to be transparent. >>Joe Weinstein at BEA Systems >> >> > |