Esri ArcObjects Snippets - Series
Create Database
// Create Database
public void createdatabase() {
String file = "D:\\work\\PAKdatabase";
// ***Create Database
try {
// Create a FileGDB workspace factory
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactory();
// Create a new File geodatabase
IWorkspaceName workspaceName = workspaceFactory
.create("D:\\work\\", "MyFGDB.gdb", null, 0);
System.out.println("workspaceName = " + workspaceName.toString());
// Cast for IName
IName name = (IName) workspaceName;
System.out.println("name = " + name.toString());
// Open a reference to the access workspace through the name object
IWorkspace workspace = new IWorkspaceProxy(name.open());
} catch (Exception e) {
e.printStackTrace();
}
}
This code has been made using ESRI Resources and other Help Content and is provided here just for educational purpose.
No comments:
Post a Comment