Facing Issues On IT

Search
Skip to content
  • Tutorials
  • Springboot & REST
  • Issues & Solutions
  • Sample Code
  • Interview Preparation
Java, JDBC

[Solved] java.sql.SQLException: ORA-28000: the account is locked

7 Jul 2018 Saurabh Gupta Leave a comment

SQLException “The account is locked”  occurs due to password policy set for user account. If user trying to connect database with wrong password so many times will lock your database account. 

Error Code ORA-28000 is for Oracle Database for account lock.

Sample Code

 try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
connection=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "admin", "saurabh");
		} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
catch (SQLException ex) {
ex.printStackTrace();
}
 

Output Message


java.sql.SQLException: ORA-28000: the account is locked
 
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388)
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381)
                at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564)
                at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431)
                at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
                at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
                at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
                at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)
                at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)
                at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:531)
                at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:221)
                at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
                at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
                at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
                at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
                at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
                at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
                at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
                at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
                at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

Issue

Here Database user account is lock due to try login database with wrong password.

There can be some other reasons also like as your DBA assigned particular IP for user and same user trying to use another machine to access database then also database account can also be locked.

Solutions

To unlock database account run follow below steps:

To unlock your Local database password

  • Execute Query

             alter user <your_username> account 

  • Check the PASSWORD_LOCK_TIME parameter. if it is set to 1 then you won’t to be able to unlock the password for 1 day even after you executed above query.

To unlock Remote Database handle by DBA:

  • Reach to you database DBA to unlock your database account because he only know what password policy implemented.

More Issues Solution

For more other JAVA/JDBC issues solution follow link JDBC Issues and Solutions.

Share this post with others:

  • More
  • Tweet

Like this:

Like Loading...

Related

java.sql.SQLExceptionORA-28000the account is lockedunlock dtabase account

Post navigation

Previous Post[Solved] JDBC : com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.Next PostJAVA : Get Host Name and IP address of Machine?

You must log in to post a comment.

Blogs By Category

Advertisements

Top Posts & Pages

  • [Solved] com.fasterxml.jackson.databind.exc. InvalidDefinitionException: Cannot construct instance of `XYZ` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
  • [Solved]: Maven Error "Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project XYZ: There are test failures."
  • [Solved] Spring Data JPA :QueryCreationException: Could not create query for public abstract method XYZ
  • [Solved] Java UnsupportedClassVersionError : Compiled by a more recent version of the Java Runtime (class file version X), this version of the Java Runtime only recognizes class file versions up to Y
  • [Solved] TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Advertisements

Recommendations

  • Java: Coding & Review Best Practices
  • JDBC Coding Best Practices
  • Spring Boot + REST Tutorial
Advertisements

Interview Questions and Answers

  • Elasticsearch Interview Questions and Answers
  • Java: Interview Questions and Answers
  • JDBC Interview Questions And Answers
  • Spring Boot + REST Tutorial
  • [100+] Frequently Asked Java Program
Advertisements
Advertisements

“Learn From Others Experience"

Java Tutorial

Java Tutorial


Java :Overview and Setup
  • Java Overview
  • Java Evaluation
  • Environment Setup
  • Upgrade JDK in Eclipse
  • "Hello World" Program
  • Program Execution
  • Execution Steps
  • main() Variations
  • JIT,JDK,JRE,SDK,JVM

Java Keywords
Java Data Types
  • Primitive Type
  • Non-Primitive Type

Java Variable & Literals
Java Idnetifiers
Java Statements
  • Blocks
  • Empty Statements
  • Declaration Statements
  • Expression Statements
  • Control Flow Statement
    • Decision Making
      • if
      • if-else
      • if-else if
      • switch
    • Looping
      • for loop
      • while loop
      • do-while loop
      • for-each loop
    • Branching
      • break
      • continue
      • return
Reachability of Statements
Java Operators
  • Unary Operators
  • Arithmatic Operators
  • Relational Operators
  • Conditional Operators
  • Bitwise Shift Operators
  • Logical Operators
  • Assignment Operators
  • Instanceof Operators
  • Boolean Operators
  • Ternary Operators
  • Operators Precedence

Java Comments
Java Documentation
Java OOPS Concepts
  • Naming Convention
  • Java Object
  • Java Class
  • Object Cretaion Ways
  • Type of Classes
  • Constructor
  • static keyword
  • this keyword

Java Inheritance
  • Inheritance(IS-A)
  • Aggregation(HAS-A)
  • Aggregation Vs Composition
  • super keyword
  • Constructor Chaining

Java Polymorphism
  • Method Overloading
  • Compiletime Polymorphism
  • Method Overriding
  • Runtime Polymorphism
  • Overloading vs Overriding
  • Covariant Return Type
  • Instance Initializer Block
  • final Keyword
  • Dynamic Binding
  • instanceof Operator

Java Abstraction
  • Abstract Class
  • Interface
  • Nested Interface
  • Marker Interface
  • Abstract Vs Interface

Java Encapsulation
  • Package
  • Import
  • Access Modifiers

OOPS Misll.
  • Java Object Class
  • Object Cloning
  • Shallow Vs Deep Cloning
  • Wrapper Class
    • Byte
    • Short
    • Integer
    • Long
    • Float
    • Double
    • Boolean
    • Character
    • Number
  • strictfp keyword

Java :Array

Java :String Handling

Java :Exception Handling

Java :Collection

Java :Date & Time

Java :IO

Java :Conversion

Java :JDBC

Java :New Features

Java :Interview Questions

Java :Logging

Java :JSON Handling

Java :YAML Handling

Java : Testing

Java :Masking
Masking Tutorial

Log4j Masking
XML Masking
Java Object Masking
Java logs Masking

Web Page Masking


  • SPI
  • Aadhar Number
  • Account Number
  • Credit Card
  • CVV/CVC
  • Date Of Birth
  • Driving License
  • IP
  • ITIN
  • Rounting Number
  • SSN
  • Passport
  • Pincode/Zipcode
JSON Tutorial

JSON Overview
JSON Data Type & Syntax
JSON Java Parsers
JSON + JACKSON
  • JSON to/from Java
  • JSON to/from Java Map
  • JSON Exclude fields
  • JSON file to/from List
  • Dynamic JSON

JSON + GSON
  • GSON Installation
  • JSON Formatting
  • JSON Null Serialization
  • JSON to/from Java

JSON + YAML
  • YAML Vs JSON
  • YAML to/from JSON
  • YAML to/from JSON List

JSON SPI Masking
Log4j JSON Configuration
JSON Issues Solutions
YAML Tutorial

YAML Introduction
YAML Supporting Language and Tools
Enable YAML Editor in Eclipse
YAML Syntax
YAML Validation Online Tools
YAML & JSON
  • YAML to JSON
  • YAML to JSON List
  • JSON vs YAML

Sample filebeat.yml
  • Filebeat Logging
  • Filebeat + Logstash
  • Filebeat + Stacktrace
  • Filebeat + Elasticsearch
  • Filebeat + Kafka
  • Filebeat+ Elasticsearch + Kibana

  • YAML Issues Solutions
JDBC Tutorial

JDBC Overview

Architecture Model

History and Features Evaluations

Drivers Types and Uses

Drivers for Databases

Connect with Database

Connect with Oracle

Connect with MySQL

Connect with Access

Driver Manager Class

Connection Interface

Exception Handling

JDBC : Stored Procedure

JDBC : Function

Differences
Statement Vs PreparedStatement Vs CallableSatement

executeQuery() Vs executeUpdate() Vs execute() method

Stored Procedure vs functions

JDBC Issues & Solutions
[Solved]ClassNotFoundException: org.hsqldb.jdbcDriver

[Solved]java.sql.SQLSyntaxErrorException: unexpected token: XYZ

[Solved]CommunicationsException: Communications link failure

[Solved] SQLException: No suitable driver

[Solved]SQLServerException: Invalid object name ‘dual’

[Solved]SQLSyntaxErrorException: Unknown database ‘database_name’

[Solved]SQLException: ORA-28000: the account is locked

[Solved] MySQLNonTransientConnectionException: Could not create connection to database server.

[Solved]SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near…

[Solved]SQLException: Can’t drop database ‘database_name’; database doesn’t exist


Maven Tutorial

Maven Overview

Maven Installation
  • Install On Window
  • Install On Linux

Add 3rd Party & external jar
Application Creation
  • Java Console Project
  • Dynamic Web Application + Eclipse
Issues & Solutions
  • [Solved] Maven: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a
  • Maven Connect Timeout from/to Central “https://repo.maven.apache.org/maven2”
  • [Solved] Could not transfer artifact org.springframework:XYZ from/to central (https://repo.maven.apache.org/maven2”
  • [Solved] Maven Error On Eclipse/STS : Could Not Calculate Build Plan Org.Apache.Maven.Plugins:maven-Jar-Plugin:jar:2.4
  • [Solved] Maven Error On Eclipse/STS : Failure To Transfer Org.Apache.Maven.Plugins:maven-Surefire-Plugin:pom:2.12.4
Gradle Tutorial


Gradle Overview
Ant vs maven
Maven Vs Gradle
Gradle : Installation
  • Gradle on Window
  • Gradle on Linux/Mac

Gradle : Eclipse/STS Integration
Gradle : Repository
Gradle : Dependency
Gradle : Tasks
Gradle : Logging
Logging Tutorial

Java :Logging
  • Log4j Overview
  • Log4j2 New Features
  • Compare Other Frameworks

Log4J XML Configuration
  • Log4j Dependency
  • Log4j Severity Levels
  • Log4j Log Formatting
  • Log4j Log Appenders
  • Log4j Rolling File Appenders

Log4J JSON Configuration
  • JSON Dependency
  • JSON Configuration

Centralize Logging
  • Integrate Filebeat, Kafka, Logstash, Elasticsearch and Kibana

Logs Masking
  • Mask Logs SPI
  • Mask XML SPI
  • Mask JSON SPI
  • Mask Java Object SPI

Log4J Issues & Solutions
  • [Solved] ClassCastException: SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
JUnit/Mockito Tutorial

  • Software Testing
  • Unit Testing
  • JUnit

JUnit 5
  • JUnit 5: Introduction
  • JUnit 5: Architecture
  • Junit 5: Env Setup
  • JUnit 5: Write Test Case

Mocking Frameworks
  • JUnit + Mockito
  • Exception Hierarchy

Code Coverage
  • JUnit : Code Coverage
  • Code Coverage Plugin

Issues & Solutions
  • Mockito Issues

Best Practices
  • JUnit : Best Practices
Advertisements
Advertisements
Advertisements

Java Tutorial


Java :Overview and Setup
  • Java Overview
  • Java Evaluation
  • Environment Setup
  • Upgrade JDK in Eclipse
  • "Hello World" Program
  • Program Execution
  • Execution Steps
  • main() Variations
  • JIT,JDK,JRE,SDK,JVM

Java Keywords
Java Data Types
  • Primitive Type
  • Non-Primitive Type

Java Variable & Literals
Java Idnetifiers
Java Statements
  • Blocks
  • Empty Statements
  • Declaration Statements
  • Expression Statements
  • Control Flow Statement
    • Decision Making
      • if
      • if-else
      • if-else if
      • switch
    • Looping
      • for loop
      • while loop
      • do-while loop
      • for-each loop
    • Branching
      • break
      • continue
      • return
Reachability of Statements
Java Operators
  • Unary Operators
  • Arithmatic Operators
  • Relational Operators
  • Conditional Operators
  • Bitwise Shift Operators
  • Logical Operators
  • Assignment Operators
  • Instanceof Operators
  • Boolean Operators
  • Ternary Operators
  • Operators Precedence

Java Comments
Java Documentation
Java OOPS Concepts
  • Naming Convention
  • Java Object
  • Java Class
  • Object Cretaion Ways
  • Type of Classes
  • Constructor
  • static keyword
  • this keyword

Java Inheritance
  • Inheritance(IS-A)
  • Aggregation(HAS-A)
  • Aggregation Vs Composition
  • super keyword
  • Constructor Chaining

Java Polymorphism
  • Method Overloading
  • Compiletime Polymorphism
  • Method Overriding
  • Runtime Polymorphism
  • Overloading vs Overriding
  • Covariant Return Type
  • Instance Initializer Block
  • final Keyword
  • Dynamic Binding
  • instanceof Operator

Java Abstraction
  • Abstract Class
  • Interface
  • Nested Interface
  • Marker Interface
  • Abstract Vs Interface

Java Encapsulation
  • Package
  • Import
  • Access Modifiers

OOPS Misll.
  • Java Object Class
  • Object Cloning
  • Shallow Vs Deep Cloning
  • Wrapper Class
    • Byte
    • Short
    • Integer
    • Long
    • Float
    • Double
    • Boolean
    • Character
    • Number
  • strictfp keyword

Java :Array

Java :String Handling

Java :Exception Handling

Java :Collection

Java :Date & Time

Java :IO

Java :Conversion

Java :JDBC

Java :New Features

Java :Interview Questions

Java :Logging

Java :JSON Handling

Java :YAML Handling

Java : Testing

Java :Masking

Tutorials

  • Data Structure and Programming Tutorial
  • Elasticsearch Tutorial
  • Filebeat Tutorial
  • Java : IO Tutorial
  • Java: Date and Time Tutorial
  • Java: Exception Handling Tutorial
  • JDBC Tutorial
  • JSON Tutorial
  • Junit 5 Tutorial
  • Kafka Tutorial
  • Logstash Tutorial
  • Maven Tutorial
  • Mockito + JUnit Tutorial
  • Spring Boot + REST Tutorial
  • TIKA Tutorial
  • YAML Tutorial

Issues Solutions

  • Camel Issues & Solutions
  • Eclipse/STS Issues & Solutions
  • Elasticsearch Issues
  • Filebeat Issues
  • Gradle Issues & Solutions
  • Hibernate Issues & Solutions
  • JAVA Issues and Solutions
  • JAXB Issues & Solutions
  • JDBC Issues and Solutions
  • JSON Issues Solutions
  • Junit/Mockito Issues & Solutions
  • Kafka and Zookeeper Issues
  • Logging/Log4j Issues & Solutions
  • Logstash Issues & Solutions
  • Maven Issues & Solutions
  • MySQL Issues & Solutions
  • OpenShift Issues & Solutions
  • Python Issues & Solutions
  • Spring Boot + REST Tutorial
  • Springboot Data/JPA Issues & Solutions
  • SQL Server Issues & Solutions
  • TIKA Issues and Solutions
  • Tomcat Issues & Solutions
  • YAML Issues

Interview Questions and Answers

  • Elasticsearch Interview Questions and Answers
  • Java: Interview Questions and Answers
  • JDBC Interview Questions And Answers
  • Spring Boot + REST Tutorial
  • [100+] Frequently Asked Java Program

Follow Our Blogs via Email

Enter your email address to follow this blog and receive notifications of our new posts by email.

Join 2,407 other subscribers

Recommendations

  • Java: Coding & Review Best Practices
  • JDBC Coding Best Practices
  • Spring Boot + REST Tutorial
Contact
%d bloggers like this: