设为首页 加入收藏

TOP

如何在Linux环境下调试Java程序使用访问Timesten
2014-11-24 12:55:59 来源: 作者: 【 】 浏览:0
Tags:何在 Linux 环境 调试 Java 程序 使用 访问 Timesten

一.如何在linux环境下调试JAVA程序使用访问timesten:


1.配置jdk环境变量:


[timesten@ora11gr2 ~]$ javac
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files and annotation processors
-cp Specify where to find user class files and annotation processors
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-endorseddirs Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor [,,...]Names of the annotation processors to run; bypasses default discovery process
-processorpath Specify where to find annotation processors
-d Specify where to place generated class files
-s Specify where to place generated source files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J Pass directly to the runtime system


[timesten@ora11gr2 ~]$ javac -version
javac 1.6.0_07


2.编写JAVA测试代码:


[timesten@ora11gr2 ~]$ cat TTtest.java
import java.sql.*;
import javax.sql.*;
public class TTtest{
public static void main(String args[])
{
//String URL = "jdbc:timesten:client:dsn=lujgCS_1122"; Remote Connect Strings
String URL = "jdbc:timesten:direct:dsn=lujg_1122";


Connection con = null;
try {
Class.forName("com.timesten.jdbc.TimesTenDriver");
}
catch (ClassNotFoundException ex)
{ex.printStackTrace();
}
try {
con = DriverManager.getConnection(URL);
System.out.println("connected");
java.sql.Statement st=con.createStatement();
java.sql.ResultSet rs=st.executeQuery("select * from test");
while (rs.next())
{
System.out.println(rs.getString("id"));
}


con.close();
} catch (SQLException ex) {
ex.printStackTrace();}
}
}


编译程序:


[timesten@ora11gr2 ~]$ javac TTtest.java
[timesten@ora11gr2 ~]$ ll
-rw-r--r-- 1 timesten oinstall 1395 Mar 8 10:13 TTtest.class
-rwxr-xr-x 1 timesten oinstall 715 Mar 8 10:13 TTtest.java


查看执行结果:


[timesten@ora11gr2 ~]$ java TTtest
connected
100
200
300


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇用 Ruby 开发 iOS 应用 —— Ruby.. 下一篇android opensource: eclipse 进..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)
·索引堆及其优化 - 菜 (2025-12-24 20:18:50)
·Shell 中各种括号的 (2025-12-24 19:50:39)
·Shell 变量 - 菜鸟教 (2025-12-24 19:50:37)