2 import java
.util
.Properties
;
3 import java
.util
.StringTokenizer
;
4 import java
.sql
.Driver
;
5 import java
.sql
.DriverManager
;
6 import java
.sql
.SQLException
;
7 import java
.sql
.Connection
;
8 import java
.sql
.DriverPropertyInfo
;
10 public final class JdbcSqlDriver
extends JSqlError
implements Driver
, JSqlErrorType
16 DriverManager
.registerDriver(new JdbcSqlDriver());
20 System
.out
.println ("CSql JDBC Driver: " + e
);
23 public boolean acceptsURL(String url
)
26 String trimURL
= url
.toLowerCase().trim();
27 StringTokenizer tokens
= new StringTokenizer(trimURL
, ":", false);
29 while(tokens
.hasMoreTokens())
31 String t
= tokens
.nextToken().trim();
35 if( t
.equalsIgnoreCase("jdbc") )
42 if( t
.equalsIgnoreCase("csql") )
53 if(tokenNo
!= 3) return false;
56 public Connection
connect(String connectString
, Properties info
) throws SQLException
61 throw getException(CSQL_AUTHEN_ERR
);
63 if(!acceptsURL(connectString
))
64 throw getException(CSQL_AUTHEN_ERR
);
66 //System.loadLibrary("crypt");
67 //System.loadLibrary("csql");
68 //System.loadLibrary("csqlsql");
69 System
.loadLibrary("csqljdbc");
71 uName
= info
.getProperty("user");
72 pword
= info
.getProperty("password");
73 JdbcSqlConnection con
= new JdbcSqlConnection(uName
, pword
);
74 return((Connection
) con
);
76 public DriverPropertyInfo
[] getPropertyInfo (String connectString
,
77 java
.util
.Properties info
) throws SQLException
81 public int getMajorVersion()
85 public int getMinorVersion()
89 public boolean jdbcCompliant()