-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated project data reading exmaples
- Loading branch information
1 parent
9ee5814
commit 09064e0
Showing
9 changed files
with
406 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 48 additions & 34 deletions
82
content/english/java/project-data-reading/read-access-database/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,62 @@ | ||
--- | ||
title: Reading Project Data from Microsoft Access Database with Aspose.Tasks | ||
title: Reading Project Data from MS Access Database in Aspose.Tasks | ||
linktitle: Reading Project Data from Microsoft Access Database with Aspose.Tasks | ||
second_title: Aspose.Tasks Java API | ||
description: | ||
description: Learn how to read MS Project data from a Microsoft Access database using Aspose.Tasks for Java. Follow our step-by-step tutorial for seamless integration. | ||
type: docs | ||
weight: 11 | ||
url: /java/project-data-reading/read-access-database/ | ||
--- | ||
|
||
## Complete Source Code | ||
## Introduction | ||
Aspose.Tasks for Java is a powerful API that allows developers to work with Microsoft Project files seamlessly in Java applications. In this tutorial, we'll focus on reading MS Project data from a Microsoft Access database using Aspose.Tasks. | ||
## Prerequisites | ||
Before we get started, make sure you have the following: | ||
### Java Development Kit (JDK) Installed | ||
Ensure you have Java Development Kit (JDK) installed on your system. You can download and install the latest version from the official Oracle website. | ||
### Aspose.Tasks for Java Library | ||
Download and include the Aspose.Tasks for Java library in your project. You can get it from the Aspose website. Follow the [download link](https://releases.aspose.com/tasks/java/) to obtain the library. | ||
|
||
## Import Packages | ||
First, you need to import the necessary packages into your Java project to use Aspose.Tasks functionalities. | ||
```java | ||
/* | ||
* Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved. | ||
* | ||
* This file is part of Aspose.Tasks. The source code in this file | ||
* is only intended as a supplement to the documentation, and is provided | ||
* "as is", without warranty of any kind, either expressed or implied. | ||
*/ | ||
|
||
|
||
|
||
import com.aspose.tasks.MpdSettings; | ||
import com.aspose.tasks.Project; | ||
import com.aspose.tasks.SaveFileFormat; | ||
|
||
|
||
import java.io.IOException; | ||
``` | ||
|
||
public class ReadingProjectDataFromMicrosoftAccessDatabase { | ||
// ExStart: ReadingProjectDataFromMicrosoftAccessDatabase | ||
public static void main(String[] args) { | ||
// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java | ||
// The path to the documents directory. | ||
String dataDir = "Your Data Directory"; | ||
|
||
MpdSettings settings = new MpdSettings(getConnectionString(), 1); | ||
Project project = new Project(settings); | ||
project.save(dataDir + "project1.xml", SaveFileFormat.Xml); | ||
} | ||
|
||
private static String getConnectionString() { | ||
return "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=" + "mpdFile.mpd"; | ||
} | ||
// ExEnd: ReadingProjectDataFromMicrosoftAccessDatabase | ||
} | ||
|
||
Let's break down the example code into multiple steps: | ||
## Step 1: Define Data Directory | ||
Set the path to the directory where you want to save the Project XML file. | ||
```java | ||
String dataDir = "Your Data Directory"; | ||
``` | ||
## Step 2: Define MpdSettings | ||
Initialize the MpdSettings object with the connection string to the Microsoft Access database and the project identifier. | ||
```java | ||
MpdSettings settings = new MpdSettings(getConnectionString(), 1); | ||
``` | ||
## Step 3: Load Project from Database | ||
Create a new Project object by passing the MpdSettings instance. | ||
```java | ||
Project project = new Project(settings); | ||
``` | ||
## Step 4: Save Project Data | ||
Save the project data to an XML file. | ||
```java | ||
project.save(dataDir + "project1.xml", SaveFileFormat.Xml); | ||
``` | ||
|
||
## Conclusion | ||
In this tutorial, we've learned how to read MS Project data from a Microsoft Access database using Aspose.Tasks for Java. By following the provided steps, you can efficiently integrate this functionality into your Java applications. | ||
## FAQ's | ||
### Q: Can I use Aspose.Tasks for Java with other database systems besides Microsoft Access? | ||
A: Yes, Aspose.Tasks supports various database systems like SQL Server, MySQL, and Oracle. | ||
### Q: Is there a free trial available for Aspose.Tasks for Java? | ||
A: Yes, you can get a free trial from [here](https://releases.aspose.com/). | ||
### Q: How can I get technical support for Aspose.Tasks for Java? | ||
A: You can get technical support from the [Aspose.Tasks forum](https://forum.aspose.com/c/tasks/15). | ||
### Q: Do I need a temporary license to use Aspose.Tasks for Java? | ||
A: You may need a temporary license for some advanced features. Get it from [here](https://purchase.aspose.com/temporary-license/). | ||
### Q: Where can I purchase Aspose.Tasks for Java? | ||
A: You can purchase Aspose.Tasks for Java from [this link](https://purchase.aspose.com/buy). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.