How to Export or Import oracle database using CLI

SQL, Unix By Dec 20, 2016 No Comments

Oracle database is providing some command line tools to import or export any schema , data of a schema or the total oracle database from one to another. These tools come along with the oracle database installation by default.Exporting: There are two command tools to export database exp and expdp. exp command: Open the console and give the exp command on…

java.sql.SQLException: stale connection

If you are getting the exception “java.sql.SQLException: stale connection” then you should check whether the Connection object is closed anywhere in the app and you are trying to access the same object. In this case, the object is closed and no longer available, so you can not do any execution on that object. Solution is to create a fresh connection…

Using excel file as DB and read data from Java

Java, SQL By May 14, 2014 No Comments

We can use an excel file as a data base. Using java we can create connection to excel file and execute sql query as we do with database. Use the below code to use excel file as a DB and read data from it using java. String stExcelFile=”c:\temp\test.xls”; String stSheetName=”Sheet1”; Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);         Connection conExcel = DriverManager.getConnection(“jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=” +…

Inserting Date and Time in database

SQL By Feb 06, 2013 No Comments

I want to insert date and time into a field of a Oracle table whose data type is “Date”. To do so, I have used the below command. to_date(‘2011/12/12 11:15:00’, ‘yyyy/mm/dd hh24:mi:ss’) Example: Table definition:  create table ATG(local_id varchar2(50) primary key,Last_Sale Date, Last_Sale_Value varchar2(50),Total_12_month_Value  varchar2(50)); In the above table, I want to insert data and time to “Last_Sale field”. Insert…

Hi, Welcome here.
And get notified everytime we publish a new blog post.