This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "J2EE Bad Practices: getConnection()"

From OWASP
Jump to: navigation, search
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Fortify}}
+
{{template:CandidateForDeletion}}
  
{{Template:Vulnerability}}
+
#REDIRECT [[Failure to follow guideline/specification]]
  
==Abstract==
 
  
The J2EE standard forbids the direct management of connections.
+
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
 
==Description==
 
==Description==
 +
 +
The J2EE standard forbids the direct management of connections.
  
 
The J2EE standard requires that applications use the container's resource management facilities to obtain connections to resources.
 
The J2EE standard requires that applications use the container's resource management facilities to obtain connections to resources.
  
==Examples ==
+
 
 +
 
 +
==Risk Factors==
 +
 
 +
TBD
 +
 
 +
==Examples==
  
 
For example, a J2EE application should obtain a database connection as follows:
 
For example, a J2EE application should obtain a database connection as follows:
Line 25: Line 32:
 
Every major web application container provides pooled database connection management as part of its resource management framework. Duplicating this functionality in an application is difficult and error prone, which is part of the reason it is forbidden under the J2EE standard.
 
Every major web application container provides pooled database connection management as part of its resource management framework. Duplicating this functionality in an application is difficult and error prone, which is part of the reason it is forbidden under the J2EE standard.
  
==Related Threats==
 
  
==Related Attacks==
+
==Related [[Attacks]]==
 +
 
 +
* [[Attack 1]]
 +
* [[Attack 2]]
 +
 
 +
 
 +
==Related [[Vulnerabilities]]==
 +
 
 +
* [[Vulnerability 1]]
 +
* [[Vulnerabiltiy 2]]
 +
 
 +
 
 +
==Related [[Controls]]==
  
==Related Vulnerabilities==
+
* [[Control 1]]
 +
* [[Control 2]]
  
==Related Countermeasures==
 
  
==Categories==
+
==Related [[Technical Impacts]]==
  
[[Category:Implementation]]
+
* [[Technical Impact 1]]
 +
* [[Technical Impact 2]]
  
[[Category:Java]]
 
  
[[Category:Communication]]
+
==References==
  
[[Category:Code Snippet]]
+
TBD

Latest revision as of 20:16, 7 April 2009

Template:CandidateForDeletion

#REDIRECT Failure to follow guideline/specification


Last revision (mm/dd/yy): 04/7/2009

Description

The J2EE standard forbids the direct management of connections.

The J2EE standard requires that applications use the container's resource management facilities to obtain connections to resources.


Risk Factors

TBD

Examples

For example, a J2EE application should obtain a database connection as follows:

 ctx = new InitialContext();
 datasource = (DataSource)ctx.lookup(DB_DATASRC_REF);
 conn = datasource.getConnection();

and should avoid obtaining a connection in this way:

 conn = DriverManager.getConnection(CONNECT_STRING);

Every major web application container provides pooled database connection management as part of its resource management framework. Duplicating this functionality in an application is difficult and error prone, which is part of the reason it is forbidden under the J2EE standard.


Related Attacks


Related Vulnerabilities


Related Controls


Related Technical Impacts


References

TBD