采用java链接timesten内存数据库
来源:互联网 发布:手机淘宝2015旧版本 编辑:程序博客网 时间:2024/05/18 01:54
虽然主要是做TT的维保,但是由于TT使用的人相对少,很少相关的资料,就两java如何连接TT都很难找到,这里从官方文档中摘抄一段,做下记录备查。
##Write the below program in a file MyConnectionTest.java using vi or your favorite text editor.
#MyConnectionTest.java
import java.sql.*;
class MyConnectionTest {
/* This is DSN that we specify in odbc.ini file */
static String dsnname = "myjdbctest";
/* URL to connect to the datastore, that contains the standard prefix and dsnname */
static String url = "jdbc:timesten:direct:" + dsnname;
public static void main (String args[])
{
/* Try to load the driver first */
try {
Class.forName("com.timesten.jdbc.TimesTenDriver");
} catch (ClassNotFoundException ex) {
System.out.println ("Failed to load the driver");
ex.printStackTrace();
}
/* Try to get the connecction to TimesTen datastore and close it*/
try {
Connection con = DriverManager.getConnection(url);
System.out.println ("Connection Success");
con.close();
} catch (SQLException ex) {
System.out.println ("Failed to connect/disconnect to TimesTen datastore");
ex.printStackTrace();
}
}
编译:
javac MyConnectionTest.java
执行:
java MyConnectionTest
----------------------------End-------------------------------------------------
##Write the below program in a file MyConnectionTest.java using vi or your favorite text editor.
#MyConnectionTest.java
import java.sql.*;
class MyConnectionTest {
/* This is DSN that we specify in odbc.ini file */
static String dsnname = "myjdbctest";
/* URL to connect to the datastore, that contains the standard prefix and dsnname */
static String url = "jdbc:timesten:direct:" + dsnname;
public static void main (String args[])
{
/* Try to load the driver first */
try {
Class.forName("com.timesten.jdbc.TimesTenDriver");
} catch (ClassNotFoundException ex) {
System.out.println ("Failed to load the driver");
ex.printStackTrace();
}
/* Try to get the connecction to TimesTen datastore and close it*/
try {
Connection con = DriverManager.getConnection(url);
System.out.println ("Connection Success");
con.close();
} catch (SQLException ex) {
System.out.println ("Failed to connect/disconnect to TimesTen datastore");
ex.printStackTrace();
}
}
编译:
javac MyConnectionTest.java
执行:
java MyConnectionTest
----------------------------End-------------------------------------------------
0 0
- 采用java链接timesten内存数据库
- oracle内存数据库timesten
- 内存数据库 TimesTen
- TimesTen内存数据库体系结构
- 内存数据库TimesTen
- Timesten内存数据库的架构
- timesten内存数据库培训笔记
- 内存数据库——TimesTen
- Timesten内存数据库的架构
- TimesTen内存数据库问题总结
- Oracle TimesTen内存数据库学习体会
- Oralce内存数据库TimesTen简介(原创)
- 内存数据库(TimesTen)cachegroup配置指南
- TimesTen内存数据库-第二章 快速开始
- TimesTen内存数据库-第六章 Cache Administrator
- Oracle 内存数据库TimesTen 的jdbc连接
- 内存数据库大明星:TimesTen配置数据源
- 【内存数据库】Timesten安装过程全记录
- 一个冒泡排序
- android 浏览器插件开发 - 流程(1)
- Lucene.net实现搜索
- LINUX C++ 数据库连接池
- Android开发者将越来越有前途
- 采用java链接timesten内存数据库
- android 浏览器插件开发 - HelloPlugin
- 热门同性恋社交网站 看下他们是怎么运营的。
- 深入学习java的HashMap实现原理
- OCP-1Z0-051 补充题库 第6题 SELECT查询语句
- Qt之实现好友列表
- 【Python】decorator的作用
- 56. 2种方法判断二叉树是不是平衡二叉树[is balanced tree]
- 记录如何把服务器误删数据的恢复过程