|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ODBCUtil.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package nmp.dbms.util;
|
|
| 2 |
|
|
| 3 |
public class ODBCUtil { |
|
| 4 |
static {
|
|
| 5 | 0 |
System.loadLibrary( "nmp/dbms/util/ODBCUtil");
|
| 6 |
} |
|
| 7 |
|
|
| 8 |
/**
|
|
| 9 |
* Type parameter in SQLConfigDataSource
|
|
| 10 |
*/
|
|
| 11 |
public static final short ODBC_ADD_DSN = 1; // Add data source |
|
| 12 |
public static final short ODBC_CONFIG_DSN = 2; // Configure (edit) data source |
|
| 13 |
public static final short ODBC_REMOVE_DSN = 3; // Remove data source |
|
| 14 |
public static final short ODBC_ADD_SYS_DSN = 4; // add a system DSN |
|
| 15 |
public static final short ODBC_CONFIG_SYS_DSN = 5; // Configure a system DSN |
|
| 16 |
public static final short ODBC_REMOVE_SYS_DSN = 6; // remove a system DSN |
|
| 17 |
public static final short ODBC_REMOVE_DEFAULT_DSN = 7; // remove the default DSN |
|
| 18 |
|
|
| 19 |
/**
|
|
| 20 |
* Calls the SQLConfigDataSource in win32 systems
|
|
| 21 |
* @param type Type of call
|
|
| 22 |
* @param driver Driver name
|
|
| 23 |
* @param attributes Attributes string
|
|
| 24 |
*/
|
|
| 25 |
public static native boolean SQLConfigDataSource( short type, String driver, String attributes); |
|
| 26 |
|
|
| 27 | 0 |
public static void main( String[] args) throws NumberFormatException { |
| 28 | 0 |
if( args.length != 1)
|
| 29 | 0 |
System.out.println( "Use:\nODBCUtil dsn_name file_name");
|
| 30 |
else {
|
|
| 31 | 0 |
System.out.println(args[0]); |
| 32 | 0 |
System.out.println( SQLConfigDataSource( ODBC_ADD_DSN, |
| 33 |
"Microsoft Access Driver (*.mdb)",
|
|
| 34 |
args[0])); |
|
| 35 |
} |
|
| 36 |
} |
|
| 37 |
} |
|
| 38 |
|
|
||||||||||