如何将应用程序转换成安装文件 大家好 现在要做一个通讯录查询系统已经有oracle数据表, 然后要怎么才能转换成我们平时用的安装文件就是要在没有jre和数据库的电脑上能安装这个软件,并且使用里面的数据谢谢!! 真的很急 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你要把oracle数据库也打到安装文件中?这个好像不现实安装文件制作可以用installanywhere 用jdbc的thin方式 此种方法不需要安装Oracle的客户端,也不需要配置odbc,故此种方法用得比较普遍。 此方法在使用时需要将oracle的jar包加到classpath变量中,此包可以在oralce客户端程序的$ORACLE_HOME/jdbc/lib/classes12.jar找到。mport java.sql.*;public class jdbcthin {//dbUrl数据库连接串信息,其中“1521”为端口,“ora9”为sidString dbUrl = "jdbc:oracle:thin:@10.10.20.15:1521:ora9";//theUser为数据库用户名String theUser = "sman";//thePw为数据库密码String thePw = "sman";//几个数据库变量Connection c = null;Statement conn;ResultSet rs = null;//初始化连接public jdbcthin() {try {Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();//与url指定的数据源建立连接c = DriverManager.getConnection(dbUrl, theUser, thePw);//采用Statement进行查询conn = c.createStatement();} catch (Exception e) {e.printStackTrace();}}//执行查询public ResultSet executeQuery(String sql) {rs = null;try {rs = conn.executeQuery(sql);} catch (SQLException e) {e.printStackTrace();}return rs;}public void close() {try {conn.close();c.close();} catch (Exception e) {e.printStackTrace();}}public static void main(String[] args) {ResultSet newrs;jdbcthin newjdbc = new jdbcthin();newrs = newjdbc.executeQuery("select * from eventtype");try {while (newrs.next()) {System.out.print(newrs.getString("event_type"));System.out.println(":"+newrs.getString("content"));}} catch (Exception e) {e.printStackTrace();}newjdbc.close();}} 你到 百度上搜索下 java如何打包,和java打包过程 里面都有教 去1楼blog中 有详细介绍打包 java返回上一级 获取webroot下upload文件夹下图片文件 分享javase的基础题(以为学的很好,但是做起来很纠结) 请教一个简化代码的方法 学生项目分配问题,高手进!! java 二分法疑问 poi导出Excel中插入网络图片的问题||给定URL得到实际地址 返回泛型参数数组的问题??谢谢!!! 关于抽象类及接口我的理解 java中有没有得到一个数的立方根的函数啊? 很奇怪的 转型异常 菜鸟问题
mport java.sql.*;public class jdbcthin {
//dbUrl数据库连接串信息,其中“1521”为端口,“ora9”为sid
String dbUrl = "jdbc:oracle:thin:@10.10.20.15:1521:ora9";
//theUser为数据库用户名
String theUser = "sman";
//thePw为数据库密码
String thePw = "sman";
//几个数据库变量
Connection c = null;
Statement conn;
ResultSet rs = null;//初始化连接
public jdbcthin() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
//与url指定的数据源建立连接
c = DriverManager.getConnection(dbUrl, theUser, thePw);
//采用Statement进行查询
conn = c.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}//执行查询
public ResultSet executeQuery(String sql) {
rs = null;
try {
rs = conn.executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}public void close() {
try {
conn.close();
c.close();
} catch (Exception e) {
e.printStackTrace();
}
}public static void main(String[] args) {
ResultSet newrs;
jdbcthin newjdbc = new jdbcthin();
newrs = newjdbc.executeQuery("select * from eventtype");
try {
while (newrs.next()) {
System.out.print(newrs.getString("event_type"));
System.out.println(":"+newrs.getString("content"));
}
} catch (Exception e) {
e.printStackTrace();
}newjdbc.close();
}
}
里面都有教