---
title: "公开SNS社区即时找朋友链的源代码和部署方案（续三）"
author: "markhe"
date: "2012-04-23T14:46:56Z"
tags: []
categories: ["数据库"]
slug: "sns"
draft: false
lastmod: "2012-04-23T14:46:56Z"
id: 1495423
url: "https://markhe.iteye.com/blog/1495423"
---

Versant数据库可以很容易的建立和数据库之间的连接：

		Iterator<DatabaseLoginHelper> ite = this.dblist.iterator();
		
		DatabaseLoginHelper helper = (DatabaseLoginHelper)ite.next();
		session = new TransSession(helper.getDatabaseNodeProperty());
		session.setSchemaOption(TransSession.SCHEMA_ADD_DROP_ATTRIBUTES);
		
		// System.out.println("Define Logical database:");
		session.newLogicalDatabase(HPC_DEMO_NETWORK_NAME);
		
		// System.out.println("Add to logical database:"+dbList);
		session.addToLogicalDatabase(HPC_DEMO_NETWORK_NAME, helper.databaseName);
		System.out.println("Add to logical database:" + helper.databaseName);