使用JDBC连接Windchill数据库

要深入了解Windchill,就不得不了解Windchill的数据模型,平时工作中,不论是自己测试还是解决客户问题,都常常需要用Oracle的SQL Developer查询数据库,其实之前就想能不能把常用的查询做成一个小程序,好方便使用,今天就开始第一步,连接数据库,代码如下:

import java.sql.*;
public class ConnectJDBC {
	public static final String DBURL="jdbc:oracle:thin:@localhost:1521:wind";
	public static final String DBUSER = "oracle";
	public static final String DBPASS = "ts";
	public static void main(String[] args) throws Exception{
		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;
		try{
			DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
			conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
			System.out.println(conn);			
		}catch(SQLException e){
			System.out.println("An exception occurs: " + e.getMessage());
			e.printStackTrace();
		}finally{
			if(rs != null)
				rs.close();
			if(stmt != null)
				stmt.close();
			if(conn != null)
				conn.close();
		}
	}
}


  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
================================================== <!-- For Filevaults Configuration --> <Property name="wt.fv.useFvFileThreshold" overridable="true" targetFile="codebase/wt.properties" value="true"/> <Property name="wt.fv.fvFileThreshold" overridable="true" targetFile="codebase/wt.properties" value="30000"/> <Property name="wt.fv.forceContentToVault" overridable="true" targetFile="codebase/wt.properties" value="true"/> <Property name="wt.fv.purgeUnreferencedFvItemsOlderThan" overridable="true" targetFile="codebase/wt.properties" value="7"/> <Property name="wt.fv.purgeUnreferencedFvItemsInterval" overridable="true" targetFile="codebase/wt.properties" value="1"/> <!-- For System Start up --> <Property name="wt.manager.cmd.MethodServer.java.command" overridable="true" targetFile="codebase/wt.properties" value="$(wt.java.cmd.quoted) $(wt.manager.cmd.common.java.args) -Djava.protocol.handler.pkgs=HTTPClient -DHTTPClient.disableKeepAlives=true -DHTTPClient.dontChunkRequests=true -Xms1024m -Xmx1024m -XX:SurvivorRatio=8 $(wt.manager.cmd.MethodServer.platform.java.args) wt.method.MethodServerMain"/> <Property name="wt.manager.cmd.ServerManager.java.command" overridable="true" targetFile="codebase/wt.properties" value="$(wt.java.cmd.quoted) $(wt.manager.cmd.MethodServer.platform.java.args) -classpath $(wt.java.classpath.quoted) -Xms512m -Xmx1024m -Xnoclassgc -noverify wt.manager.ServerManagerMain"/> <Property name="wt.manager.cmd.BackgroundMethodServer.java.command" overridable="true" targetFile="codebase/wt.properties" value="$(wt.java.cmd.quoted) $(wt.manager.cmd.common.java.args) -Djava.protocol.handler.pkgs=HTTPClient -DHTTPClient.disableKeepAlives=true -DHTTPClient.dontChunkRequests=true -Xms1024m -Xmx1024m -Xnoclassgc -noverify wt.method.MethodServerMain wt.method.serviceName=BackgroundMethodServer wt.queue.executeQueues=true wt.queue.queueGroup=default wt.adapter.enabled=false wt.method.minPort=3000 wt.method.log.file=$(wt.logs.dir)/bgMS_$DATE(yyyy-MM-dd).log"/> <Prop
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值