Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/java/org/neuclear/commons/sql
Modified Files:
DefaultConnectionSource.java JNDIConnectionSource.java
SQLTools.java SimpleConnectionSource.java
ThreadMappedConnectionSource.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: DefaultConnectionSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/DefaultConnectionSource.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** DefaultConnectionSource.java 20 Sep 2003 23:18:11 -0000 1.1.1.1
--- DefaultConnectionSource.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 14,20 ****
* Time: 3:38:50 PM
*/
! public class DefaultConnectionSource extends ThreadMappedConnectionSource {
! public Connection createConnection() throws SQLException, IOException {
return SQLTools.getConnection();
}
--- 14,20 ----
* Time: 3:38:50 PM
*/
! public final class DefaultConnectionSource extends ThreadMappedConnectionSource {
! public final Connection createConnection() throws SQLException, IOException {
return SQLTools.getConnection();
}
Index: JNDIConnectionSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/JNDIConnectionSource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JNDIConnectionSource.java 18 Nov 2003 23:34:55 -0000 1.1
--- JNDIConnectionSource.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 28,31 ****
--- 28,37 ----
$Id$
$Log$
+ Revision 1.2 2003/11/21 04:43:42 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.1 2003/11/18 23:34:55 pelle
Payment Web Application is getting there.
***************
*** 38,49 ****
* Time: 6:09:37 PM
*/
! public class JNDIConnectionSource implements ConnectionSource {
! public JNDIConnectionSource(String name) throws NamingException {
! InitialContext ctx = new InitialContext();
this.ds = (DataSource) ctx.lookup(name);
}
! public Connection getConnection() throws SQLException, IOException {
return ds.getConnection();
}
--- 44,55 ----
* Time: 6:09:37 PM
*/
! public final class JNDIConnectionSource implements ConnectionSource {
! public JNDIConnectionSource(final String name) throws NamingException {
! final InitialContext ctx = new InitialContext();
this.ds = (DataSource) ctx.lookup(name);
}
! public final Connection getConnection() throws SQLException, IOException {
return ds.getConnection();
}
Index: SQLTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/SQLTools.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SQLTools.java 20 Sep 2003 23:18:11 -0000 1.1.1.1
--- SQLTools.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 23,27 ****
public final static java.sql.Connection getConnection() throws SQLException, IOException {
! Properties props=loadProperties();
try {
Class.forName(props.getProperty("jdbc.class")).newInstance();
--- 23,27 ----
public final static java.sql.Connection getConnection() throws SQLException, IOException {
! final Properties props=loadProperties();
try {
Class.forName(props.getProperty("jdbc.class")).newInstance();
***************
*** 43,48 ****
private static Properties loadProperties() throws IOException {
! Properties props=new Properties();
! File propsFile= new File(
System.getProperty("user.home")+
System.getProperty("file.separator")+
--- 43,48 ----
private static Properties loadProperties() throws IOException {
! final Properties props=new Properties();
! final File propsFile= new File(
System.getProperty("user.home")+
System.getProperty("file.separator")+
***************
*** 58,62 ****
}
! public final static Timestamp toTimestamp(java.util.Date date) {
if (date==null)
return null;
--- 58,62 ----
}
! public final static Timestamp toTimestamp(final java.util.Date date) {
if (date==null)
return null;
Index: SimpleConnectionSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/SimpleConnectionSource.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SimpleConnectionSource.java 20 Sep 2003 23:18:12 -0000 1.1.1.1
--- SimpleConnectionSource.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 14,19 ****
* Time: 3:38:50 PM
*/
! public class SimpleConnectionSource extends ThreadMappedConnectionSource {
! public SimpleConnectionSource(String driver, String url, String user, String password) throws SQLException{
try {
Class.forName(driver).newInstance();
--- 14,19 ----
* Time: 3:38:50 PM
*/
! public final class SimpleConnectionSource extends ThreadMappedConnectionSource {
! public SimpleConnectionSource(final String driver, final String url, final String user, final String password) throws SQLException{
try {
Class.forName(driver).newInstance();
***************
*** 30,34 ****
}
! public Connection createConnection() throws SQLException {
return DriverManager.getConnection(
url,
--- 30,34 ----
}
! public final Connection createConnection() throws SQLException {
return DriverManager.getConnection(
url,
***************
*** 38,44 ****
}
! private String url;
! private String user;
! private String password;
private Connection con;
--- 38,44 ----
}
! private final String url;
! private final String user;
! private final String password;
private Connection con;
Index: ThreadMappedConnectionSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/ThreadMappedConnectionSource.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ThreadMappedConnectionSource.java 20 Sep 2003 23:18:11 -0000 1.1.1.1
--- ThreadMappedConnectionSource.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 16,20 ****
*/
public abstract class ThreadMappedConnectionSource implements ConnectionSource {
! protected Map threadmap;
public ThreadMappedConnectionSource() {
--- 16,20 ----
*/
public abstract class ThreadMappedConnectionSource implements ConnectionSource {
! protected final Map threadmap;
public ThreadMappedConnectionSource() {
***************
*** 27,31 ****
* @throws java.sql.SQLException
*/
! public Connection getConnection() throws SQLException, IOException {
Connection con=(Connection)threadmap.get(Thread.currentThread());
--- 27,31 ----
* @throws java.sql.SQLException
*/
! public final Connection getConnection() throws SQLException, IOException {
Connection con=(Connection)threadmap.get(Thread.currentThread());
|