首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

SOS:请大家帮忙连接oracle10g 出的错误

2012-01-28 
SOS:请大家帮忙连接oracle10g 出的异常 java.sql.SQLException:ORA-01017:invalidusername/passwordlogon

SOS:请大家帮忙连接oracle10g 出的异常

java.sql.SQLException:   ORA-01017:   invalid   username/password;   logon   denied

at   oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at   oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
at   oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at   oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:277)
at   oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:784)
at   oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:361)
at   oracle.jdbc.driver.PhysicalConnection. <init> (PhysicalConnection.java:413)
at   oracle.jdbc.driver.T4CConnection. <init> (T4CConnection.java:164)
at   oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
at   oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
at   java.sql.DriverManager.getConnection(DriverManager.java:525)
at   java.sql.DriverManager.getConnection(DriverManager.java:171)
at   business.ConnectionFactory.getConnection(ConnectionFactory.java:11)
at   business.Role.validateUser(Role.java:18)
at   action.LoginAction.login(LoginAction.java:23)
at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native   Method)
at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at   java.lang.reflect.Method.invoke(Method.java:585)
at   org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at   org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at   java.lang.Thread.run(Thread.java:595)
大家帮忙看看
                  Class.forName( "oracle.jdbc.driver.OracleDriver ");
                  我的连接字符串是:Connection   con   =   DriverManager.getConnection(


"jdbc:oracle:thin:172.16.33.159:1521:orcl:o10g ",   "msUser ",
"msUserTHYX ");
                我加载的是class12驱动
      帮忙啊~~~~~!!



[解决办法]
jdbc:oracle:thin:@172.16.33.159:1521:orcl:o10g
好象要+ 个@符
[解决办法]
同上jdbc:oracle:thin:@localhost:1521:ora9i
localhost是本地也可127.0.0.1
ora9i是你连数据库的名字
你是连服务器的数据库172.16.33.159的他可未你分配了帐户连接该数据库,还有相关权限
[解决办法]
jdbc:oracle:thin:@172.16.33.159:1521:orcl:o10g
好象要+ 个@符

[解决办法]
jdbc:oracle:thin:@192.168.1.168:1521:acms

acms是数据库名称
[解决办法]
试试这个看

<%!
String DBDRIVER = "oracle.jdbc.driver.OracleDriver ";
String DBURL = "jdbc:oracle:thin:@localhost:1521:orcl ";
String DBUSER = "scott ";
String DBPASSWORD = "tiger ";
Connection conn = null;
Statement stmt = null;
%>
<%
try
{
Class.forName(DBDRIVER);
//conn = DirverManager.getConnection(DBURL,DBUSER,DBPASSWORD) ;
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD) ;
String sql = "CREATE TABLE mldntab(naem varchar(20)) ";
stmt = conn.createStatement();
stmt.executeUpdate(sql);
stmt.close();
conn.close();

}
//catch(Excecption e)
catch(Exception e)

{
out.println(e);
}

%>

热点排行