projects:microsoftaccessandjava
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projects:microsoftaccessandjava [2010/12/25 16:04] – rlunaro | projects:microsoftaccessandjava [2022/12/02 21:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Background ===== | ===== Background ===== | ||
| + | |||
| + | I have tons of msAccess databases, each of one runs a query. All of the queries are action queries, i.e. queries that dump its results into a new table, that must be erased each time. | ||
| + | |||
| + | I need to run all the queries in an ordered manner (some queries depend on others and so on..), so I quickly thought on an updating application that should be done in order to achieve the task. | ||
| + | |||
| + | For this task, and because I am orienting muy development skills through Java, I want to try to do this in java. | ||
| + | |||
| + | Let's see if it possible. | ||
| + | |||
| + | ===== Result of the project ===== | ||
| + | |||
| + | |||
| + | **Failed:** it is not possible to run an action query from java. Nor to execute a select * into table from query it is possible, because the new table appears empty (¿due to security constraints??? | ||
| + | |||
| + | **Pending: | ||
| Line 14: | Line 29: | ||
| The sql engine of access is called Jet SQL. Here is a manual: | The sql engine of access is called Jet SQL. Here is a manual: | ||
| - | http:// | + | http:// |
| + | |||
| + | {{: | ||
| + | |||
| + | There is the manual online: | ||
| + | |||
| + | * [[http:// | ||
| Line 45: | Line 66: | ||
| * an CREATE TABLE statement to build a new table | * an CREATE TABLE statement to build a new table | ||
| * a DROP TABLE statement to destroy a table | * a DROP TABLE statement to destroy a table | ||
| - | |||
| Line 53: | Line 73: | ||
| There are three things we need to do to manipulate a MS Access database: | There are three things we need to do to manipulate a MS Access database: | ||
| - | 1) Set up Java to undestand ODBC, | + | |
| - | 2) Get a connection to our MS Access Database, | + | - Set up Java to undestand ODBC, |
| - | 3) Run a SQL statement. | + | |
| + | | ||
| 1) First we need to set up Java to understand how to communicate with an ODBC data source | 1) First we need to set up Java to understand how to communicate with an ODBC data source | ||
| - | * Set up your DriverManager to understand ODBC data sources | + | * [[microsoftaccessandjava# |
| Line 66: | Line 87: | ||
| There are two ways to get a connection from your Microsoft Access Database: | There are two ways to get a connection from your Microsoft Access Database: | ||
| - | | + | - Get a connection by accessing the Database Directly |
| - | + | | |
| - | | + | |
| - | + | ||
| - | | + | |
| 3) Once you have gained access to the Database (been granted a connection), | 3) Once you have gained access to the Database (been granted a connection), | ||
| Line 78: | Line 95: | ||
| This is the section that you will be most interested in - if you're impatient, you might want to start here...but please come back and read it all! | This is the section that you will be most interested in - if you're impatient, you might want to start here...but please come back and read it all! | ||
| - | |||
| - | |||
| - | |||
| - | |||
| In addition, please refer to the section at the end of this document: | In addition, please refer to the section at the end of this document: | ||
| - | * What I assume you already know | + | * "What I assume you already know" plus a little additional reading. |
| - | + | ||
| - | Plus a little additional reading. | + | |
| - | Step 1) Set up your DriverManager to understand ODBC data sources | + | === Set up your DriverManager to understand ODBC data sources |
| The first thing we must do in order to manipulate data in the database is to be granted a connection to the database. This connection, referenced in the Java language as an Object of type java.sql.Connection, | The first thing we must do in order to manipulate data in the database is to be granted a connection to the database. This connection, referenced in the Java language as an Object of type java.sql.Connection, | ||
projects/microsoftaccessandjava.1293293071.txt.gz · Last modified: 2022/12/02 21:02 (external edit)
