Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
jTDS JDBC Driver Source Code Files
jTDS JDBC Driver Source Code Files are provided in the source package file, jtds-1.3.1-fyi.zip.
You can browse jTDS JDBC Driver Source Code files below:
✍: FYIcenter.com
⏎ net/sourceforge/jtds/jdbcx/PooledConnection.java
// jTDS JDBC Driver for Microsoft SQL Server and Sybase // Copyright (C) 2004 The jTDS Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // package net.sourceforge.jtds.jdbcx; import java.sql.*; import java.util.*; import javax.sql.*; import net.sourceforge.jtds.jdbc.*; import net.sourceforge.jtds.jdbcx.proxy.*; /** * jTDS implementation of the <code>PooledConnection</code> interface. * * @version $Id: PooledConnection.java,v 1.11.6.3 2009-12-30 08:45:34 ickzon Exp $ */ public class PooledConnection implements javax.sql.PooledConnection { private ArrayList listeners = new ArrayList(); protected Connection connection; public PooledConnection(Connection connection) { this.connection = connection; } /** * Adds the specified listener to the list. * * @see #fireConnectionEvent * @see #removeConnectionEventListener */ public synchronized void addConnectionEventListener(ConnectionEventListener listener) { // Clone the list of listeners to avoid concurrent modifications. See // bug [1113040] Small bug in net.sourceforge.jtds.jdbcx.PooledConnection // for a description of how these can occur. The method still needs to // be synchronized to prevent race conditions. listeners = (ArrayList) listeners.clone(); // Now add the listener to the new, cloned list listeners.add(listener); } /** * Closes the database connection. * * @throws SQLException if an error occurs */ public synchronized void close() throws SQLException { connection.close(); connection = null; // Garbage collect the connection } /** * Fires a new connection event on all listeners. * * @param closed <code>true</code> if <code>close</code> has been called on the * connection; <code>false</code> if the <code>sqlException</code> represents * an error where the connection may not longer be used. * @param sqlException the SQLException to pass to the listeners */ public synchronized void fireConnectionEvent(boolean closed, SQLException sqlException) { if (listeners.size() > 0) { ConnectionEvent connectionEvent = new ConnectionEvent(this, sqlException); Iterator iterator = listeners.iterator(); while (iterator.hasNext()) { ConnectionEventListener listener = (ConnectionEventListener) iterator.next(); if (closed) { listener.connectionClosed(connectionEvent); } else { try { if (connection == null || connection.isClosed()) { listener.connectionErrorOccurred(connectionEvent); } } catch (SQLException ex) { // Will never occur } } } } } /** * Returns a ConnectionProxy. * * @throws SQLException if an error occurs */ public synchronized Connection getConnection() throws SQLException { if (connection == null) { fireConnectionEvent(false, new SQLException(Messages.get("error.jdbcx.conclosed"), "08003")); return null; } // Should the SQLException be captured here for safety in the future even though // no SQLException is being thrown by the ConnectionProxy at the moment??? return new ConnectionProxy(this, connection); } /** * Removes the specified listener from the list. * * @see #addConnectionEventListener * @see #fireConnectionEvent */ public synchronized void removeConnectionEventListener(ConnectionEventListener listener) { // Clone the list of listeners to avoid concurrent modifications. See // bug [1113040] Small bug in net.sourceforge.jtds.jdbcx.PooledConnection // for a description of how these can occur. The method still needs to // be synchronized to prevent race conditions. listeners = (ArrayList) listeners.clone(); // Now remove the listener from the new, cloned list listeners.remove(listener); } /////// JDBC4 demarcation, do NOT put any JDBC3 code below this line /////// /* (non-Javadoc) * @see javax.sql.PooledConnection#addStatementEventListener(javax.sql.StatementEventListener) */ public void addStatementEventListener(StatementEventListener listener) { // TODO Auto-generated method stub throw new AbstractMethodError(); } /* (non-Javadoc) * @see javax.sql.PooledConnection#removeStatementEventListener(javax.sql.StatementEventListener) */ public void removeStatementEventListener(StatementEventListener listener) { // TODO Auto-generated method stub throw new AbstractMethodError(); } }
⏎ net/sourceforge/jtds/jdbcx/PooledConnection.java
Or download all of them as a single archive file:
File name: jtds-1.3.1-fyi.zip File size: 323160 bytes Release date: 2013-06-08 Download
⇐ What Is jtds-1.3.1-dist.zip?
2016-11-26, 7807👍, 0💬
Popular Posts:
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the c...
JDK 11 java.xml.crypto.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) Crypto modu...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...