.sql file as a input in java

Hi All,
How can I recover the data from the .sql file using java.
regards,
Maheshwaran Devaraj

Execute the commands listed in the .sql file against the database.
Either using a tool that should have come with the database or by connecting to the DB using JDBC and executing each statement this way.

Similar Messages

  • Any ideas how to execute a .sql file on database server from java?

    Any ideas how to execute a xyz.sql file (which is fisically on
    database server) from java?
    thanks

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • Java API for running entire ".sql" files on a remote DB ( mySQL or Oracle)?

    Hi,
    Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?
    It's enough if the API works with MySQL and/or Oracle.
    Just to demonstrate what i'm looking for:
    Suppose you've created sql file "c:/test.sql" with several script lines:
    -- test.sql:
    insert into TABLE1 values(3,3);
    insert into TABLE1 values(5,5);
    create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific
    Then the java API should look something like:
    // Dummy java code:
    String driver="com.mysql.jdbc.Driver";
    String url= "jdbc:mysql://localhost:3306/myDb";
    SomeAPI.executeScriptFile( "c:/test.sql", driver, url);
    Thanks.

    No such a API, but it's easy to parse all sqls in a file, then run those command:
    For instance:
    import java.sql.*;
    import java.util.Properties;
    /* A demo show how to load some sql statements. */
    public class testSQL {
    private final static Object[] getSQLStatements(java.util.Vector v) {
    Object[] statements = new Object[v.size()];
    Object temp;
    for (int i = 0; i < v.size(); i++) {
    temp = v.elementAt(i);
    if (temp instanceof java.util.Vector)
    statements[i] = getSQLStatements( (java.util.Vector) temp);
    else
    statements[i] = temp;
    return statements;
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    case '!': //Use it to get a large number of simple update statements
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    String part1 = temp.substring(1);
    String part2 = br.readLine();
    for (int i = -2890; i < 1388; i += 39)
    batchs.addElement(part1 + i + part2);
    for (int i = 1890; i < 2388; i += 53) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 4320; i > 4268; i--) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 9389; i > 7388; i -= 83)
    batchs.addElement(part1 + i + part2);
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    public static void main(String argv[]) {
    try {
    String url;
    Object[] statements;
    switch (argv.length) {
    case 0: //Use it for the simplest test
    case 1:
    url = "jdbc:dbf:/.";
    if (argv.length == 0) {
    statements = new String[1];
    statements[0] = "select * from test";
    else
    statements = argv;
    break;
    case 2:
    url = argv[0];
    statements = getSQLStatements(argv[1]);
    break;
    default:
    throw new Exception(
    "Syntax Error: java testSQL url sqlfile");
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    //Please see Connecting to the Database section of Chapter 2. Installation in Development Document
    Properties properties = new Properties();
    Connection con = DriverManager.getConnection(url, properties);
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    //Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    // stmt.setMaxRows(0);
    stmt.setFetchSize(10);
    final boolean serializeFlag = false;//A test switch to serialize/deserialize the resultSet
    ResultSet rs;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    if (serializeFlag) {
    // serialize the resultSet
    try {
    java.io.FileOutputStream fileOutputStream = new
    java.io.FileOutputStream("testrs.tmp");
    java.io.ObjectOutputStream
    objectOutputStream = new java.io.
    ObjectOutputStream(fileOutputStream);
    objectOutputStream.writeObject(rs);
    objectOutputStream.flush();
    objectOutputStream.close();
    fileOutputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    // deserialize the resultSet
    try {
    java.io.FileInputStream fileInputStream = new
    java.io.FileInputStream("testrs.tmp");
    java.io.ObjectInputStream objectInputStream = new
    java.io.ObjectInputStream(
    fileInputStream);
    rs = (ResultSet) objectInputStream.
    readObject();
    objectInputStream.close();
    fileInputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    // System.out.println(resultSetMetaData.getColumnName(j));
    /* System.out.println(resultSetMetaData.getColumnType(j));
    System.out.println(resultSetMetaData.getColumnDisplaySize(j));
    System.out.println(resultSetMetaData.getPrecision(j));
    System.out.println(resultSetMetaData.getScale(j));
    System.out.println(resultSetMetaData.
    getColumnLabel(j)
    + " " +
    resultSetMetaData.getColumnTypeName(j));
    Object colval;
    rs.beforeFirst();
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the resultSet release its open tables at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();
    stmt.close();
    con.close();
    catch (SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" + sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • Is it possible to pass a TXT file as an input of a SQL script?

    Dear all,
    I have a question about SQL scripts running in SQL*Plus. I have a table including a list of SAP UserIDs. I would like to check for several people whether their
    ID already exists. Here is how I proceed in my script file.
    SELECT sap_userid
    FROM SAPREF_USERS
    WHERE (sap_userid
    IN
         'user1',
         'user2',
         'user3',
         'user4',
         'user5',
           .          /*  So here I write one by one each userid. Consequently if a user already exists, the script will print his/her UserID */
    GROUP BY sap_userid
    ORDER BY sap_useridWell, this works, but I'm sure there should be a more intelligent method to do the job. If I put all UserIDs in a let's say a TXT file (one userid per line) is there
    any way to pass this text file as an input for the script so I may get rid of the very long IN clause in my SQL query?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    Yet Another Post Without Version.
    Typing 4 digits and 3 dots, or running select * from v$version and paste the result here
    Qualifies as work, and the very reason you post here is you want to avoid to work, or to earn as much as possible by doing as little as possible.
    In 9i and higher, the file is best treated as an external table, so the whole list of userids is replaced by
    in (select * from external_table)
    But this requires reading documentation, which again qualifies as ... work.
    Ahh, most 'DBA's here are quite hopeless.
    Sybrand Bakker
    Senior Oracle DBA

  • Run a sql file from java

    I have a SQL file named myfile.sql which contains something as follows:-Declare
    Begin
    insert into alphaweb values (1);
    end;
    .What I am looking for is a way to execute this through a java code. e.g. something like reading the String from the the file and executing it.
    public static boolean executeScript(File script, Connection conn) {
              boolean success = true;
              success = script.exists();
              if (success) {
                   System.out.println("ES::READING SCRIPT:" + script.getAbsolutePath());
                   StringBuffer buffer = null;
                   try {
                        buffer = readFileAsString("myfile.sql");
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   }//new StringBuffer();
                   //success = readScript(script, buffer);
                   if (null!=buffer) {
                        try {
                             String creationScript = buffer.toString();
                             Statement st = conn.createStatement();
                             int start = 0;
                             int end = 0;
                             while (end != -1 && start < creationScript.length()) {
                                  end = creationScript.lastIndexOf ('/');
                                  if (end != -1) {
                                       System.out.println(creationScript.substring(start, end));
                                       st.executeUpdate(creationScript.substring(start, end));
                                       start = end + 2; // 2 is the length of "GO"
                             st.close();
                        } catch (Exception e) {
                             success = false;
                             System.out.println(e);
              } else {
                   System.out.println("ES::SCRIPT FILE DOES NOT EXISTS");
                   success = false;
              return success;
         }But it is failing any ideas if it is possible and what am I doing wrong?

    I believe the sample that you provided only has a single statement in it.
    Do the files only contain one block like that?
    If yes then you should be able to process them as a single statement. Just drop the terminator at the end (maybe wrap it in another block statement...)
    If not then your solutions are.
    1. Parse the file yourself.
    2. Use the oracle command line tool and feed it to that.

  • Invoking .SQL file from JAVA

    Hi All,
    Anyway of calling .SQL files from JAVA ??
    thanks in advance..

    What do you mean by calling?
    Are you talking about a stored procedure? Then yes.typo !!
    i meant invoking .SQL script only...
    No not stored procedure..i mean running or invoking a sql file containing sql statements(inserts etc)

  • .sql file through Java and procedures

    I want to execute .sql file (on my local system) to run on a oracle database.
    Also please tell me how can I run multiple procedure simultenously through Java class.
    Thanks in Anticipation

    First you need a multi-CPU machine or you're never going to execute more than one statement at once.
    Next you need to know how to create a multithreaded program.
    After that, you need to figure out how to read that file and separate the statements in it so each can be fed to one of those threads.

  • How to run SQL files from Java?

    Hi,
    Can someone point me towards a link on how to run sql files in Java? Thanks.
    P.S...if I've been completely blind please go easy on me!

    Sorry forgot the formating code thingy
    public static boolean executeScript(File script, Connection conn){
        boolean success = true;
        success = script.exists();
        if(success){
          DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
          StringBuffer buffer = new StringBuffer();
          success=readScript(script,buffer);
          if(success){
            try{
              String creationScript = buffer.toString();
              Statement st = conn.createStatement();
              int start = 0;
              int end = 0;
              while (end != -1 && start < creationScript.length()) {
                end = creationScript.indexOf("GO", start);
                if (end != -1) {
                  DEBUG.print(creationScript.substring(start, end));
                  st.executeUpdate(creationScript.substring(start, end));
                  start = end + 2; //2 is the length of "GO"
              st.close();
            }catch(Exception e){
              success=false;
              DEBUG.printStackTrace(e);
        }else{
          DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
          success=false;
        return success;
      public static boolean readScript(File script, StringBuffer buffer){
        boolean success = true;
        DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
        try{
          InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
          int ch;
          while ( (ch = isr.read()) > -1) {
            buffer.append( (char) ch);
          if (isr != null)
            isr.close();
        }catch(Exception e){
          success=false;
          DEBUG.printStackTrace(e);
        return success;
      }

  • Andrew - one more doubt in the donsample.sql file,it is urgent

    Andrew,
    I believe you can answer this ,i hope i am not trying too much on your patience.Thanks .I am connected to the oracle server.In that i execute a procedure which i believe is executing on the oracle server.i supply arguments to it .The arguement is a file on my local directory .The error code follows:-
    I have problem running a oracle procedure which uses a xml parser built on java libraries.When i executed this procedure the following error came:-
    SQL> execute domsample('\oraclexdk\xdk\demo\plsql\parser','family.xml','error.txt');
    BEGIN domsample('\oraclexdk\xdk\demo\plsql\parser','family.xml','error.txt'); END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.SecurityException: relative pathnames are not
    allowed(\oraclexdk\xdk\demo\plsql\parser)
    ORA-06512: at "SYS.XMLPARSERCOVER", line 0
    ORA-06512: at "SYS.XMLPARSER", line 144
    ORA-06512: at "IWADM.DOMSAMPLE", line 77
    ORA-06512: at line 1
    Do you know something about this .ie. classpath variables or something like that.if you want the domsample arguement syntax for further clarifications ,i am enclosing this in the following lines.The setbasedir(p,dir) prompts for a parser object and a complete directory path.what i give here is the path on my local directory and i think this creates the error.
    How do i rectify this error.is it on my(client) side or the server side.If it on the oracle server side or my side can you tell me what went wrong.The parser and the dom package everything else is working fine.It is really urgent ,andrew.This is holding up all the work.The arguement syntax help says on 'dir' that this is a pointer to external file system .I have a confusion that whether this refers to external file system of the server or the client.if so form the server how to route it to the client directory or should i have a space on the server, upload this file and execute the domsample.sql file.Can you clear this concept for me.
    'dir' - must point to a valid directory on the external file system
    and should be specified as a complete path name
    'inpfile' - must point to the file located under 'dir', containing the
    XML document to be parsed
    'errfile' - must point to a file you wish to use to record errors; this
    file will be created under 'dir'
    I know i might be bugging you ,but your answers are really great.Thanks.
    regards
    gopal

    I seem to have this error with both windows and unix directory space.Please help me with debugging this .I am really struck with it.The error occurs at the same line when executed with the file on the unix server.
    SQL> execute domsample('/user/sb8066/','family.xml','error.txt');
    BEGIN domsample('/user/sb8066/','family.xml','error.txt'); END;
    ERROR at line 1:
    ORA-20100: Error occurred while parsing: Permission denied
    ORA-06512: at "SYS.XMLPARSER", line 22
    ORA-06512: at "SYS.XMLPARSER", line 69
    ORA-06512: at "IWADM.DOMSAMPLE", line 63
    ORA-06512: at line 1
    I won't clutter the forum.just to get your attention,i hope you can help me solving this problem,please can you see this thread,because in future i will be using this only to contact you.Thanks for the continued help.The windows space idea was not used.Many configurations had to be changed.Can you note what is peculiar at line 22 ,line 69.line 63 of domsample reads is just an 'end-if';I will expecting your answer as soon as possible.
    regards
    gopal

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • An Error has occurred: File Repository server input is down

    Hello Team,
    I am getting the following error message "An Error has occurred: File Repository server input is down" when try to upload exel or any other document in repository using . NET Infoview. Even with the Admin account.
    and 
    If i try the same steps from Java Infoview i am able to upload the excel.
    I guess some issue with IIS .
    Env Dtls:
    BO XI 3.1 SP3
    IIS 7
    Windows server 2008.
    Waiting for your valuable suggestions.
    Regards,
    Sonu Pandita

    Hi Team,
    I resolved this issue by giving one user a permission on temp folder.
    Regards,
    Sonu Pandita

  • "completion insight" and "change case as you type" won't work for sql file

    Hi there,
    Just updated to 3.1 on my Mac Lion. It's very likely a bug since it used the work with 3.0.
    I have a "temp.sql" file where I store several queries. I start SQL Developer, open "temp.sql", connect to a DB but "completion insight" and "change case as you type" won't work anymore.
    If I click in "Unshared SQL Worksheet", the new worksheet tab will work fine with completion and change case, but I want to use my temp.sql and save things there when closing the application.
    To reproduce yourself the issue:
    Open SQL Dev, connect to a DB (it will open a worksheet), do some queries and check that change case and completion are working, quit SQL Dev, but save the worksheet in a sql file before. Re-open SQL Dev and open the sql file. Connect to the same DB and try to change the queries or create another. Completion and change case won't work anymore.
    About
    Oracle SQL Developer 3.1.07
    Version 3.1.07
    Build MAIN-07.42
    Copyright © 2005, 2011 Oracle. All Rights Reserved.
    IDE Version: 11.1.1.4.37.59.48
    Product ID: oracle.sqldeveloper
    Product Version: 11.2.0.07.42
    Version
    Component     Version
    =========     =======
    Java(TM) Platform     1.6.0_31
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42

    Well, it's partially working, if your sql file is big (like mine), say with more than 1000 lines, then, maybe because of memory usage, the automatic completion won't work as expected, though, sometimes, after a while, crtl-space would stil work.
    So, the problem may have been addressed, but I believe this feature can be definitely improved.

  • Can't open sql file in subfolders.

    Hi,
    1. I can’t open any file by Windows Browser, right click, and open with SQL Developer if the file is located in subfolder which is several levels deep from C:\.
    2. I can’t use Files (from SQL Developer) to browse subfolders than 7 or 8 levels deep from C:\.
    In the first case SQL Developer starts (if not running) without to open the file. If the sql file is located in first 3, 4 levels of sub folders – works.
    In the second case it just stopped working. In the panel (Files) Loading … appears and nothing.
    I change Tools/Preferences/Navigation level from 20 to 50 – same!
    Windows 7 Enterprise 8 GB
    SQL Developer Version 3.1.07 Build MAIN-07.42
    JDK 1.6
    Moreover SQL Developer uses 700 MB memory. It was 200 - 300 MB on Windows XP.
    If somebody has similar experience - please help?
    Konstantin

    Hi Gary,
    I am sending the log without CTRL-Break. The problem is same as the another thread.
    This is the error of the very beginning.
    C:\sqldeveloper\sqldeveloper\bin>sqldeveloper.exe
    _execv() failed, err=2Registered TimesTen
    These are errors before the SQLDeveloper to stop.
    Exception in thread "IconOverlayTracker Timer" java.lang.OutOfMemoryError: Java
    heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.
    java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390
    at java.lang.StringBuffer.append(StringBuffer.java:224)
    at org.tmatesoft.svn.core.SVNErrorMessage.getFullMessage(SVNErrorMessage
    .java:257)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorMana
    ger.java:58)
    at org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory.open(SVN
    AdminAreaFactory.java:163)
    at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.doOpen(SVNWCAcce
    ss.java:364)
    at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.open(SVNWCAccess
    .java:272)
    at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.open(SVNWCAccess
    .java:265)
    at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.open(SVNWCAccess
    .java:261)
    at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.ja
    va:316)
    at org.tmatesoft.svn.core.javahl.SVNClientImpl.status(SVNClientImpl.java
    :296)
    at org.tmatesoft.svn.core.javahl.SVNClientImpl.status(SVNClientImpl.java
    :278)
    at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapte
    r.getStatus(AbstractJhlClientAdapter.java:480)
    at org.tigris.subversion.svnclientadapter.svnkit.SvnKitClientAdapter.get
    Status(SvnKitClientAdapter.java:141)
    at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapte
    r.getStatus(AbstractJhlClientAdapter.java:466)
    at oracle.jdevimpl.vcs.svn.SVNURLInfoCacheSimpleStrategy.getURLInfo(SVNU
    RLInfoCacheSimpleStrategy.java:79)
    at oracle.jdevimpl.vcs.svn.SVNURLInfoCache.getPropStatus(SVNURLInfoCache
    .java:59)
    at oracle.jdevimpl.vcs.svn.SVNStatusResolver.getStatus(SVNStatusResolver
    .java:159)
    at oracle.jdevimpl.vcs.svn.SVNStatusResolver.populateStatuses(SVNStatusR
    esolver.java:82)
    at oracle.jdevimpl.vcs.generic.GenericClient$2.getImpl(GenericClient.jav
    a:531)
    at oracle.jdeveloper.vcs.spi.VCSStatusCache.getValuesImpl(VCSStatusCache
    .java:31)
    at oracle.jdeveloper.vcs.spi.VCSURLBasedCache.getValues(VCSURLBasedCache
    .java:107)
    at oracle.jdeveloper.vcs.spi.VCSStatusCache.get(VCSStatusCache.java:63)
    at oracle.jdeveloper.vcs.spi.VCSOverlayItemProducer.getOverlayItems(VCSO
    verlayItemProducer.java:63)
    at oracle.jdeveloper.vcs.spi.VCSNodeOverlayTracker.getOverlays(VCSNodeOv
    erlayTracker.java:288)
    at oracle.ide.explorer.IconOverlayTracker.processPendingNodes(IconOverla
    yTracker.java:574)
    at oracle.ide.explorer.IconOverlayTracker.access$1400(IconOverlayTracker
    .java:69)
    at oracle.ide.explorer.IconOverlayTracker$7.run(IconOverlayTracker.java:
    487)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
    This is the error log after the "Loading...".
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Timer al
    ready cancelled.
    at java.util.Timer.sched(Timer.java:354)
    at java.util.Timer.schedule(Timer.java:170)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher.updateVisibleNodes
    (IconOverlayTracker.java:802)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher.access$3000(IconOv
    erlayTracker.java:713)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher$NodeUserListener.t
    reeExpanded(IconOverlayTracker.java:969)
    at javax.swing.JTree.fireTreeExpanded(JTree.java:2666)
    at javax.swing.JTree.setExpandedState(JTree.java:3427)
    at javax.swing.JTree.expandPath(JTree.java:2163)
    at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java
    :2204)
    at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTree
    UI.java:2191)
    at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(Basic
    TreeUI.java:2149)
    at com.jgoodies.looks.plastic.PlasticTreeUI.access$900(PlasticTreeUI.jav
    a:120)
    at com.jgoodies.looks.plastic.PlasticTreeUI$MouseHandler.mousePressed(Pl
    asticTreeUI.java:276)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:26
    2)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:26
    2)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:26
    2)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:26
    2)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:26
    2)
    at java.awt.Component.processMouseEvent(Component.java:6287)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at oracle.ideimpl.explorer.CustomTree.processMouseEvent(CustomTree.java:
    220)
    at java.awt.Component.processEvent(Component.java:6055)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4653)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4233)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)
    at java.awt.Window.dispatchEventImpl(Window.java:2482)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:621)
    at java.awt.EventQueue$2.run(EventQueue.java:619)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.IllegalStateException: Timer already cancelled.
    at java.util.Timer.sched(Timer.java:354)
    at java.util.Timer.schedule(Timer.java:170)
    at oracle.ide.explorer.IconOverlayTracker._scheduleUpdateTask(IconOverla
    yTracker.java:498)
    at oracle.ide.explorer.IconOverlayTracker.scheduleUpdateTask(IconOverlay
    Tracker.java:449)
    at oracle.ide.explorer.IconOverlayTracker.repaintConsumerOverlays(IconOv
    erlayTracker.java:432)
    at oracle.ide.explorer.IconOverlayTracker.access$000(IconOverlayTracker.
    java:69)
    at oracle.ide.explorer.IconOverlayTracker$2.stateChanged(IconOverlayTrac
    ker.java:114)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher.setVisibleNodes(Ic
    onOverlayTracker.java:843)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher.access$2800(IconOv
    erlayTracker.java:713)
    at oracle.ide.explorer.IconOverlayTracker$NodeWatcher$4.run(IconOverlayT
    racker.java:818)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:616)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Maybe you are looking for

  • Win 8.1 Pro Key Problem or not ?

    Okay so i just brought a new  computer with win 8.1 pro  Installed windows when it asked for the key i tried to type the numbers that where on the blue folder thingy i had win8 cd in an it wouldent let me use the number 0  so i couldent do any thing.

  • I have a question so help me out

    Yeah so anyway, in itunes i like have these folders but when i try to "drag" the music or song or whatever into the folder it doesnt work. why. thanks

  • Oder closed, but really closed?

    Hi, We have a sales order. This order it is closed, but only apparently, because when we open the Open Item List report it is still remaining like if it was opened! We are using version 2005A PL16. Do you know why this could be happennig? Could it be

  • Basic type for product hierarchy v/76

    Hi all, I have another task that need to configure once a product hierarchy is created in Tcode v/76, it will trigger an outbound IDOC and send out. Can anyone explain to me what basic type or message type should be used in this case? Thanks for help

  • I would like to put the results of a proc on a local database into a table in my azure db. What is the best way to do this?

    I would like to put the results of a proc on a local database into a table in my azure db.  What is the best way to do this?  I dont see the ability to link.  The local db is on my desktop and is mssql12. McC