activiti连接H2数据库问题

环境:activiti版本5.14,tomcat6,jdk6
把activiti-explorer.war放到tomcat里面运行之后,
http://localhost:8080/activiti-explorer/是可以访问的,
建个java工程写个main方法如下

public static void main(String[] args) {
    ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().buildProcessEngine();
}

结果报错如下:

org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)

数据库连接都是activiti自带的连接,不知道是哪个搞错了,有谁知道吗?

`

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Activiti 内嵌数据库H2
-
jsp连接h2例子
一、通过server形式连接 1.将h2.jar复制到web-inf/lib 2.配置web.xml <listener>      <listener-class>org.h2.server.web.DbStarter</listener-class>  </listener> <!-- H2 DB Info --&...
连接H2 数据库
连接h2有两种方式tcp和内存模式 tcp能用客户端工具来连接,可以看到数据内容,但是清理表时会出现并发的问题 jdbc:h2:tcp://localhost/mem:demodb 内存模式,稳定但是看不到数据内容 jdbc:h2:mem:demodb h2客户端工具 h2-setup-2014-04-05.rar ----------------- h2和oracle...
h2连接模式
h2连接模式>嵌入方式:本地使用JDBC访问>服务器方式:远程通过TCP/IP使用JDBC,ODBC访问>混合方式:同时兼容嵌入方式和服务器方式 嵌入方式jdbc:h2:[file:][<path>]<databaseName>>home目录jdbc:h2:~/test>其他jdbc:h2:file:c:/xxxjdbc:h2:file:/...
IDEA 连接H2数据库
目录 环境 链接 安装 连接模式 启动 使用服务器 从命令行启动服务器工具 database 连接 ​ 连接成功   H2数据库主要是安装方便,轻便。做一些测试类的项目时用的正好。换了新工作,以前公司的数据库不能再用了,新公司用的是虚拟桌面,只能自己想办法,突然想起了H2,为了用IDEA链接上H2 我这个小白花了emmm 5秒 ,在此记录一下。 环境 系统 win1...
小问题:If (TemVar And &H2) = &H2
If (TemVar And &H2) = &H2 Thenrnrnrnrn&H2是什么意思?
【H2】H2入门
h2是一个轻量级的数据库,一般用于测试。 首先我们通过网上下载相应的h2的压缩包解压 然后在当前目录下进入cmd界面 接下来我们就会进入一个网页 输入密码后,即可进入h2的操作界面 这样就能对h2的数据库进行操作了。
H2接口H2协议H2数据形式
通讯协议采用TCP/IP标准协议,客服系统中的业务功能作为Client向Server发送请求,Server为运行于营业系统的应用程序,用于实时监听客服系统的业务请求并作出响应,根据请求包头中的业务类型代码,访问不同业务系统的数据DB,提供客服系统所需的数据。
连接数据库问题
package com.mwq;rnrnimport java.sql.CallableStatement;rnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnimport java.util.ArrayList;rnimport java.util.List;rnrnpublic class TestInsert rnrn private static final String DRIVERCLASS = "com.microsoft.jdbc.sqlserver.SQLServerDriver";rnrn private final String url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=db_database12";rnrn private final String username = "sa";rnrn private final String password = "123";rnrn private Connection conn;rnrn private Statement stmt;rnrn private PreparedStatement prpdStmt;rnrn private CallableStatement cablStmt;rnrn static rn try rn Class.forName(DRIVERCLASS);rn catch (ClassNotFoundException e) rn System.out.println("------ 在加载数据库驱动时抛出异常,内容如下:");rn e.printStackTrace();rn rn rnrn // 执行静态INSERT语句rn public void insertOne(String name) throws SQLException rn conn = DriverManager.getConnection(url, username, password);rn stmt = conn.createStatement();rn stmt.executeUpdate("insert into tb_testInsert(name) values('" + namern + "')");// 执行静态INSERT语句rn stmt.close();rn conn.close();rn rnrn // 执行动态INSERT语句rn public void insertMore(String[] names) throws SQLException rn conn = DriverManager.getConnection(url, username, password);rn prpdStmt = connrn .prepareStatement("insert into tb_testInsert(name) values(?)");// 预处理动态INSERT语句rn prpdStmt.clearBatch();// 清除Batchrn for (int i = 0; i < names.length; i++) rn prpdStmt.setString(1, names[i]);// 为动态SQL语句赋值rn prpdStmt.addBatch();// 向Batch中添加INSERT语句rn rn prpdStmt.executeBatch(); // 批量执行Batch中的INSERT语句rn prpdStmt.close();rn conn.close();rn rnrn // 通过存储过程执行INSERT语句rn public void insertProcedure(String[] names) throws SQLException rn conn = DriverManager.getConnection(url, username, password);rn cablStmt = conn.prepareCall("call test_insert(?)");// 调用存储过程rn cablStmt.clearBatch();rn for (int i = 0; i < names.length; i++) rn cablStmt.setString(1, names[i]);rn cablStmt.addBatch();rn rn cablStmt.executeBatch();rn cablStmt.close();rn conn.close();rn rnrn // 查询所有记录rn public List selectAll() rn List list = new ArrayList();rn try rn conn = DriverManager.getConnection(url, username, password);rn stmt = conn.createStatement();rn ResultSet rs = stmt.executeQuery("select * from tb_testInsert");rn while (rs.next()) rn Object note[] = new Object[2];rn for (int i = 0; i < note.length; i++) rn note[i] = rs.getObject(i + 1);rn rn list.add(note);rn rn stmt.close();rn conn.close();rn catch (SQLException e) rn System.out.println("------ 在检索记录时抛出异常,内容如下:");rn e.printStackTrace();rn rn return list;rn rnrnrnrn我有这样的一段连接数据库代码,但里面没有main()方法,我该怎么运行,怎么看连接成功。。rn不要笑我,刚学,什么都不懂,请高手帮忙
连接数据库问题.
import javax.swing.*;rnimport java.awt.*;rnimport java.awt.event.*;rnimport java.sql.*;rnpublic class Login rn JFrame frame;rn JPanel panel;rn JLabel lblName,lblPwd;rn JTextField txtName;rn JPasswordField txtPwd;rn JButton btnLogin,btnCancel;rn GridLayout fr;rnrn public Login()rn frame=new JFrame("login form");rn panel=new JPanel();rn lblName=new JLabel("userName:");rn lblPwd=new JLabel("Password:");rn txtName=new JTextField(15);rn txtPwd=new JPasswordField(15);rn btnLogin=new JButton("login");rn btnCancel=new JButton("Cancel");rn fr= new GridLayout(3,2);rn rn rn panel.setLayout(new GridLayout(3,2));rn panel.add(lblName);rn panel.add(txtName);rn panel.add(lblPwd);rn panel.add(txtPwd);rn panel.add(btnLogin);rn panel.add(btnCancel);rn rn MyListener mylist=new MyListener();rn btnLogin.addActionListener(mylist);rn btnCancel.addActionListener(mylist);rn rn rn frame.getContentPane().add(panel);rn frame.setSize(300, 200);rn frame.setVisible(true);rn rn //注册监听器rn class MyListener implements ActionListenerrn public void actionPerformed(ActionEvent evt)rn Object obj=evt.getSource();rn if(obj==btnLogin)rn //获取文本数据转换成string rn String name=txtName.getText().trim();rn String Pwd=String.valueOf(txtPwd.getPassword()).trim();rn try rn //加载驱动程序rn Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");rn //建立数据库连接rn Connection con=DriverManager.getConnection("jdbc:odbc:mydb","sa","");rn //创建SQL语句 并发性 rn PreparedStatement pstmt=con.prepareStatement("select * from user where user_id=? and pwd=?");rnrn pstmt.setObject(1, "dutu");rn pstmt.setObject(2, 12312);rn if(name.equals(pstmt.getString(1).trim())&&Pwd.equals(pstmt.getString(2)))rn rn JOptionPane.showMessageDialog(null,"login success");rn return;rn rn rn //同上rn JOptionPane.showMessageDialog(null, "login failed");rn //关闭流rn con.close();rn rn rn //抛出异常rn catch(ClassNotFoundException e)rn System.out.println(e.getMessage());rn rn catch(SQLException e)rn System.out.println(e.getMessage());rn rn rn rn //清空文本框rn if(obj==btnCancel)rn txtName.setText("");rn txtPwd.setText("");rn rn rn rn rn public static void main(String []s)rn new Login();rn rn rnrnrnrnrnrnif(name.equals(pstmt.getString(1).trim())&&Pwd.equals(pstmt.getString(2)))rnrn我已建好了数据库.高手们看看 帮我改下.rn
连接数据库问题.
请问. 用sys用户可以启动实例, 可装载不了数据库,用startup pfile可以启动数据库. rn可是用一般用户. 就启动不了实例. 改怎么改就可以呢. 可以用一般用户也可以正常启动. 装载数据库呢??rn请各位帮帮忙?
连接数据库问题?
JavaBean单独测试时可输出数据库内容,但从Jsp中调用JavaBean时Rs为空,帮忙看一下;rn1。JavaBeanrnpackage WebMail;rnimport java.sql.*;rnpublic class connrnrn Connection connect=null;rn ResultSet rs=null;rn Statement stmt=null;rn public conn()rn rn tryrn rn Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");rn rn catch(java.lang.ClassNotFoundException e)rn rn System.err.println(e.getMessage());rn rn rn public ResultSet executeQuery(String sql)rn rn tryrn rn connect=DriverManager.getConnection("jdbc:odbc:WebMail","sa","");rn stmt=connect.createStatement();rn rs=stmt.executeQuery(sql);rn while(rs.next())rn rn String col1=rs.getString(2);rn String col2=rs.getString("password");rn System.out.print(col1);rn System.out.print(col2);rn rn rn catch(SQLException ex)rn rn System.err.println(ex.getMessage());rn rn return rs;rn rn /* public static void main(String[] areg)rn rn conn n=new conn();rn n.executeQuery();rn rn */rnrn2。rn<%@ page contentType="text/html; charset=gb2312" %>rn<%@ page language="java" import="java.sql.*" %>rnrnrnrnrn rn rn rn rn 成员登陆rn rn rn rn rn 名 字: rn rn rn 密 码: rn rn rn | 密码忘了,找一下 | 注册新用户 | rn rn rn rn rnrn<%! rn public String getStr(String str)rn rn tryrn rn String temp_p=str;rn byte[] temp_t=temp_p.getBytes("ISO8859-1");rn String temp=new String(temp_t);rn return temp;rn rn catch(Exception e)rn return null;rn rn%>rn<%! rn String logname,logpass;rn boolean loginAttempt=false;rn boolean loginOK=false;rn String errorMessage="请您登陆";rn%>rn<%rn if(request.getParameterValues("login")!=nullrn &&request.getParameterValues("logname")!=nullrn &&request.getParameterValues("logpass")!=null)rn rn loginAttempt=true;rn rn if(loginAttempt)rn rn logname=request.getParameter("logname");rn logpass=request.getParameter("logpass");rn logname=getStr(logname);rn logpass=getStr(logpass);rn String sql="select * from member where logname='"+logname+"'";rn ResultSet RS=userBean.executeQuery(sql);//估计问题是userBean.executeQuery(sql)这一句rn int rowscount=0;rn tryrn rn while(RS.next())rn rn rowscount++;rn rn rn catch(Exception e)rn if(rowscount!=0)rn rn errorMessage="成功登陆";rn session.setAttribute("username",logname);rn loginOK=true;rn if(loginOK)rn out.println("ssdfsdf");rn response.sendRedirect("main.jsp");rn rn rn elsern rn errorMessage="您的用户名或密码不正确";rn session.setAttribute("username","");rn out.print("");rn out.print(" ");rn out.print(" ");rn out.print(" "+errorMessage+"");rn out.print("");rn out.print("");rn out.print("");out.print(rowscount);rn out.print(RS);rn rn rn%>rnrnrn估计问题是userBean.executeQuery(sql)这一句rn
连接数据库问题!!
OleDbDataAdapter mycom=new OleDbDataAdapter("select password,grade from admin where name=@name",mycon);rn mycom.SelectCommand.Parameters.Add(new OleDbParameter("@name",OleDbType.Char,50));rn mycom.SelectCommand.Parameters["@name"].Value=TextBox1.Text;rn DataSet ds=new DataSet();rn int row=mycom.Fill(ds,"admin");rn if(row==0)rn rn Response.Write(" ");rn rn if(ds.Tables["admin"].Rows[0][0].ToString()==TextBox2.Text)rn rn Response.Redirect("main.aspx");rn Session["user"]=TextBox1.Text;rnrn rn rn elsern rn Response.Write(" ");rn rn mycon.Close();rnrnrnrnrnSystem.IndexOutOfRangeException: 在位置 0 处没有任何行。数据库中有数据并且输入正确的数据也提示该错误!请高手帮忙解答!
连接数据库问题!!!!
我的机器(XP)连接服务器上SQL SERVER很快,程序安装在98机器上就要一分钟才能连接上,为什么???rnrn部分代码如下,请大侠们帮忙看看,谢谢!!!rnrn Dim myConnection As SqlConnectionrn Dim mySqlDataAdapter As SqlDataAdapterrnrn Dim frmStatusMessage As New frmStatus()rn myConnection = New SqlConnection("data source=" & SERVER_NAME _ & ";initial catalog=" & DB_NAME & ";user id=oyjc;PWD=oyjc")rn mySqlDataAdapter = New SqlDataAdapter("Select * from " & DB_TABLE,_ myConnection)rnrn Tryrn Dim ds As DataSetrn ds = New DataSet()rn mySqlDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKeyrn frmStatusMessage.Show("正在连接到服务器[" & SERVER_NAME & "],_ rn 请等待......")rn mySqlDataAdapter.Fill(ds, DB_TABLE)rn Dim i As Integerrn For i = 0 To ds.Tables(0).Rows.Count - 1rn combobox1.Items.Add(ds.Tables(0).Rows(i).Item(3))rn Nextrn combobox1.SelectedIndex = 0rn Catch exp As Exceptionrn MessageBox.Show(exp.Message, exp.Source, MessageBoxButtons.OK,_ MessageBoxIcon.Error)rn Finallyrn frmStatusMessage.Close()rn End Tryrnrn
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview