Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 3336 Details for
Bug 31148
freezes when editing a java file and adding while(st.hasMoreTokes())
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
The java file
SQLConnection.java (text/plain), 3.04 KB, created by
Johan Compagner
on 2003-02-06 14:58:14 EST
(
hide
)
Description:
The java file
Filename:
MIME Type:
Creator:
Johan Compagner
Created:
2003-02-06 14:58:14 EST
Size:
3.04 KB
patch
obsolete
>import java.io.BufferedInputStream; >import java.io.BufferedReader; >import java.io.IOException; >import java.io.InputStreamReader; >import java.sql.Blob; >import java.sql.PreparedStatement; >import java.sql.ResultSet; >import java.sql.ResultSetMetaData; >import java.sql.SQLException; >import java.sql.Statement; >import java.sql.Types; >import java.util.StringTokenizer; >import java.util.logging.Level; > >import org.xml.sax.Attributes; >import org.xml.sax.ContentHandler; >import org.xml.sax.SAXException; >import org.xml.sax.helpers.AttributesImpl; > >/** > * @author cedron > * @version $Id: SQLConnection.java,v 1.27 2003/02/05 12:17:17 qa1 Exp $ > */ >public class SQLConnection { > > ///////////////////////////////////////////////////////////////////////////// > // cache the connection > ///////////////////////////////////////////////////////////////////////////// > private java.sql.Connection conn = null; > > public void executeConnection(String statement, Object[] array, String name, Object info, ContentHandler resultXML) throws SAXException { > > /////////////////////////////////////////////////////////////////////// > // get the connection from the xaconnection > /////////////////////////////////////////////////////////////////////// > > StringBuffer sb = new StringBuffer(); > StringTokenizer st = new StringTokenizer(statement," \n\r\t"); > > > ResultSet rset = null; > PreparedStatement prepStmt = null; > java.sql.Connection conn = null; > try { > /////////////////////////////////////////////////////////////////////// > // what kind of statement is it? > // if the data node is not null then it is a prepared statement > /////////////////////////////////////////////////////////////////////// > > prepStmt = conn.prepareStatement(statement); > if (1 != -1) { > try { > // just for performance we try to set the fetchsize to the rowcount. > prepStmt.setFetchSize(1); > } catch (Exception e) { > } > } > > rset = prepStmt.executeQuery(); > > ///////////////////////////////////////////////////////////////////////// > // get the resultset meta data > // get the values from the resultset and append them to the resultXML > ///////////////////////////////////////////////////////////////////////// > if (rset != null) { > if (2 > 0) { > boolean b = false; > try { > b = rset.absolute(2); > } catch (Exception e) { > } > > if (!b) { > int counter = 0; > while (rset.next() && ++counter < 1); > } > } > } > > ///////////////////////////////////////////////////////////////////////// > // commit the current transaction > ///////////////////////////////////////////////////////////////////////// > > conn.commit(); > } catch (SQLException e) { > try { > conn.rollback(); > } catch (SQLException ex) { > //ignore > } > > > // throw new ConnectionException( e); > } finally { > > try { > if (rset != null) { > rset.close(); > } > if (prepStmt != null) { > prepStmt.close(); > } > } catch (SQLException e) { > } > > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 31148
: 3336