📄 readme
字号:
Overview
This is a sneak peek of a free type 4 JDBC driver for SQLServer and
Sybase ASE. Currently it has only been tested mostly on SQLServer 6.5
and 7.0. The driver is not complete yet, but Methods that aren't
implemented will throw a SQLException with the message "Not
implemented".
You may get a copy of the current source at
ftp://freetds.internetcds.com:/pub/freetds_jdbc
You can get more information about the FreeTDS project at
http://www.freetds.org
Please send bug reports to
freetds-jdbc-bugs@internetcds.com
Please send the bug reports in plain text. Bug reports in HTML will
probably be ignored. Bugs reports that contain no information
e.g. "There's a bug. Fix it. Thank you" _WILL_ be ignored.
Bug reports that contain a nice small repeatable examples (see the
unittest directory for examples) will receive the most attention.
Connecting to a Database
The name to use in the Class.forName() is
com.internetcds.jdbc.tds.Driver
and it accepts any of the following forms of URLs-
jdbc:freetds:sqlserver://servername/database
jdbc:freetds:sqlserver://servername:port/database
jdbc:freetds:sybase://servername/database
jdbc:freetds:sybase://servername:port/database
jdbc:freetds://servername/database (These last two forms are
jdbc:freetds://servername:port/database obsolete and should not be used.)
The driver can also recognize several properties in the URL. The
properties include-
CHARSET Character set to use. Defaults to iso_1.
user user name that will be used to connect to the database.
password password used to connect to the database.
APPNAME Application name to tell to the database.
Defaults to "jdbclib".
PROGNAME Program name to tell to the database.
Defaults to "java_app".
TDS TDS protocol version to use. Can be "4.2", "5.0", or "7.0".
Defaults to "4.2".
e.g. "jdbc:freetds:sqlserver://servername/database;CHARSET=cp950;TDS=7.0"
The class com.internetcds.jdbc.tds.SybaseDriver is no longer needed
and has been retained only for backward compatibility. It should not
be used for new code.
Right now unless you specify sybase it defaults to port 1433 for
SQLServer and port 7100 for Sybase. Generally you will need to
specify the port number for Sybase, but not for SQLServer.
JDBC 2.0
The driver can be compiled for JDBC version 2.0. You will need to
change the value of JDBC_VER in the Makefile to 2_0. Note- Most of
the new 2.0 methods are just stubs that throw an SQLException.
Multiple Statements per Connection
Unlike some JDBC drivers, the FreeTDS driver supports multiple active
statements per connection. Many JDBC drivers implicitly close
statements before the close() or finalize() are called. This, IMHO is
incorrect. The FreeTDS driver keeps the statement (and the associated
database connection) open until you explicitly close it.
What this means is you must call Statement.close() when you are
finished with a statement. If you don't close it you will leak
database connections and eventually your program will fail with an
error similar to
A database manager error occurred.
SQL State: null
Logon failed. Msg 17809, Lvl 14, State 1, Unable to
connect. The maximum number of '10' configured user
connections are already connected. System Administrator can configure
to a higher value with sp_configure. , Server , Procedure , Line 0
Some commercial programs and Java development tools fail to close
their statements and connections. IBM's VisualAge for Java for
example provides a com.ibm.ivj.db.uibeans.Select class that is
terrible about creating a new statement for every query and never
closing any of them.
TEXT and NTEXT Columns
By default SQLServer will only return a maximum of 4096 bytes of a
TEXT or NTEXT column. If you try to retrieve columns that are more
than 4096 bytes, you must first change the TEXTSIZE setting for the
JDBC statement. Please look for 'SET TEXTSIZE' in the "SQL Server
Books Online" for more information.
Problems with NT 4 SP6
The driver will not run on NT 4.0 with service pack 6. Microsoft
broke a number of things in their TCP/IP stck. For more information
see:
http://support.microsoft.com/support/kb/articles/Q245/6/78.asp
If you have SP6 installed, you must upgrade to SP6a before the JDBC
driver (or most other software) will work.
Status
Status summary as of January 12, 2001
* The driver now compiles and runs with either JDBC 1.0 or 2.0.
There is a variable in the Makefile to choose which driver
you would like.
* The makefile is a hopeless mess. Creting a makefile that
works under Win32, Unix, javac, jikes, JDBC 1.0 and JDBC 2.0 is
more of a challenge than one might think.
* I haven't done much with Callable statements. Since it is
derived from the PreparedStatement class many portions will
work.
* The Connection class is mostly implemented. Code dealing with
catalogs, and the warning chain is not implemented.
* The DatabaseMetaData class still has ~60 methods not implemented.
I still haven't implemented enough methods to run most visual
development tools.
* The Driver class is fully functional.
* The PreparedStatement class does not have all the data types
implemented yet. The warning chain code is not implemented.
setBytes() is implemented for IMAGE data. This should give
some support for people that need BLOBS.
* The ResultSet does not have all the getXXX() methods implemented
yet. getObject() is implemented for all SQLServer datatypes.
cursors are not implemented. The warning chain is not implemented
yet.
* The ResultSetMetaData class currently implements only-
isNullable()
isReadOnly()
isAutoIncrement()
getColumnCount()
getColumnDisplaySize()
getColumnLabel()
getColumnName()
getColumnType()
getColumnTypeName()
isCurrency()
getScale()
isSearchable()
* The Statement class is mostly implemented. It is missing
cursor support and the warning chain code.
Query timeouts and the cancel() method are working for SQLServer but
not for Sybase.
Transactions are implemented, but I have not made a thorough code
review yet.
Multiple result sets from a single query are supported.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -