如果(设好SQL Server的ODBC之后)写下面的设置则OK <Realm
className="org.apache.catalina.realm.JDBCRealm"
connectionURL="jdbc:odbc:ACCDIY_SQL_ODBC"
debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
roleNameCol="role"
userCredCol="password"
userNameCol="username"
userRoleTable="u_user_role"
userTable="u_users"
/>
如果用MS的SQL Server JDBC Driver的话写如下设置,侧出上面说的错误
<Realm
className="org.apache.catalina.realm.JDBCRealm"
connectionName="sa"
connectionPassword="sa"
connectionURL="jdbc:microsoft:sqlserver://CPKF-FANGK:1433;User=sa;Password=sa"
debug="99"
driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
roleNameCol="role"
userCredCol="password"
userNameCol="username"
userRoleTable="u_user_role"
userTable="u_users"
/>(没有写代码)
className="org.apache.catalina.realm.JDBCRealm"
connectionURL="jdbc:odbc:ACCDIY_SQL_ODBC"
debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
roleNameCol="role"
userCredCol="password"
userNameCol="username"
userRoleTable="u_user_role"
userTable="u_users"
/>
如果用MS的SQL Server JDBC Driver的话写如下设置,侧出上面说的错误
<Realm
className="org.apache.catalina.realm.JDBCRealm"
connectionName="sa"
connectionPassword="sa"
connectionURL="jdbc:microsoft:sqlserver://CPKF-FANGK:1433;User=sa;Password=sa"
debug="99"
driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
roleNameCol="role"
userCredCol="password"
userNameCol="username"
userRoleTable="u_user_role"
userTable="u_users"
/>(没有写代码)
解决方案 »
- 使用poi3.7,excel文件转CSV的问题,急!!!-送分40
- 加了<s:debug>后页面会不显示出来!
- 项目在ECLIPSE中编译不了是怎么回事?
- 小弟郁闷了,msn登陆不了了
- 关于JAVA servelt的问题
- 不同页面的传值问题
- 如何判断图片为空,并自动显示默认图片
- 数据库数据和页面显示不一致
- 新手问:<input type="button" value="测试" onclick='test(1)'>这里调用test函数能用参数吗?例如:...onclick='test(' + 标签值 + ')'>
- 请教servlet中session的问题
- 一个Servlets问题?
- JSP取Oracle里的字符串1变成了0x312020202020202020?
jdbc:microsoft:sqlserver://CPKF-FANGK:1433;User=sa;Password=sa这个URL我在程序里试过,是可以正常访问SQL Server的
className="org.apache.catalina.realm.JDBCRealm"
connectionName="sa"
connectionPassword="sa"
connectionURL="jdbc:microsoft:sqlserver://CPKF-FANGK:1433;DatabaseName=XXXXXXXXXXXXX" <===
debug="99"
driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
roleNameCol="role"
userCredCol="sa" <==
userNameCol="sa" <==
userRoleTable="u_user_role"
userTable="u_users"
/>
加上SelectMethod=cursor之后,真的可以了,能说说为什么吗?(我会尽快结贴的)
注:原因如下:
SelectMethod (cont.) Direct—The direct method sends the complete result set in one
request to the driver. It is useful for queries that only produce a
small amount of data that you fetch completely. You should avoid
using direct when executing queries that produce a large amount
of data, as the result set is cached completely on the client and
constrains memory. In this mode, each statement requires its own
connection to the database. This is accomplished by "cloning"
connections. Cloned connections use the same connection
properties as the original connection; however, because
transactions must occur on a single connection, auto commit
mode is required. Due to this, JTA is not supported in direct mode.
In addition, some operations, such as updating an insensitive
result set, are not supported in direct mode because the driver
must create a second statement internally. Exceptions generated
due to the creation of cloned statements usually return an error
message similar to “Cannot start a cloned connection while in
manual transaction mode.”
Cursor—When the SelectMethod is set to cursor, a server-side
cursor is generated. The rows are fetched from the server in
blocks. The JDBC Statement method setFetchSize can be used to
control the number of rows that are fetched per request. The
cursor method is useful for queries that produce a large amount
of data, data that is too large to cache on the client. Performance
tests show that the value of setFetchSize has a serious impact on
performance when SelectMethod is set to cursor. There is no
simple rule for determining the value that you should use. You
should experiment with different setFetchSize values to find out
which value gives the best performance for your application.
The default is direct.