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
);
24 public boolean acceptsURL(String url
)
27 String trimURL
= url
.toLowerCase().trim();
28 StringTokenizer tokens
= new StringTokenizer(trimURL
, ":", false);
30 while(tokens
.hasMoreTokens())
32 String t
= tokens
.nextToken().trim();
36 if( t
.equalsIgnoreCase("jdbc") )
43 if( t
.equalsIgnoreCase("csql") )
48 }else if (t
.equalsIgnoreCase("gateway") )
60 if(tokenNo
!= 3) return false;
63 public Connection
connect(String connectString
, Properties info
) throws SQLException
68 throw getException(CSQL_AUTHEN_ERR
);
70 if(!acceptsURL(connectString
))
71 throw getException(CSQL_AUTHEN_ERR
);
73 //System.loadLibrary("crypt");
74 //System.loadLibrary("csql");
75 //System.loadLibrary("csqlsql");
76 System
.loadLibrary("csqljdbc");
78 uName
= info
.getProperty("user");
79 pword
= info
.getProperty("password");
80 JdbcSqlConnection con
= new JdbcSqlConnection(mode
, uName
, pword
);
81 return((Connection
) con
);
83 public DriverPropertyInfo
[] getPropertyInfo (String connectString
,
84 java
.util
.Properties info
) throws SQLException
88 public int getMajorVersion()
92 public int getMinorVersion()
96 public boolean jdbcCompliant()