Sql exception access denied

well as the topic says I get an access denied exception. This is when I try to connect to the database
java.sql.SQLException: Access denied for user 'Java'@'localhost' (using password: YES)
I get the same problem when I try to connect with the root user.
this is the code I'm using, ignore the threads as they do not matter
devil_server.java
import java.io.*;
import java.net.MalformedURLException;
import java.net.*;
import java.sql.*;
import java.util.*;
public class devil_server
//variable types concerning userthreads
static public int uid;
static public int nou;
static public ServerSocket skanal;
public static Vector users = new Vector();
public static Vector usernames = new Vector();
public static String user;
public static String pass;
     public static void main(String arg[])
     try {
          System.out.println("write the user used to access the mysql database with Devil Chat");
          user = Keyboard.readString(); //read mysql username from keyboard
          System.out.println("write the password used to access the mysql database with Devil Chat");
          String pass = Keyboard.readString(); //read password for user from keyboard
          uid = 0;
          nou = 0; //Number Of Users
          skanal = new ServerSocket(5555);
          new Thread(new devil_server_user(uid)).start();
          while(true)
               if(uid>nou)
                    String buffer = "buffer";
                    String userl = "user";
                    users.add(buffer);
                    usernames.add(userl);
                    new Thread(new devil_server_user(uid)).start();
                    nou++;
        }//end while
          }/*end try*/ catch (Exception ex) {
           ex.printStackTrace();
          }//end catch
          //con.close
     } //end main
}//end classdevil_server_user.java
import java.io.*;
import java.net.MalformedURLException;
import java.net.*;
import java.util.*;
import java.sql.*;
public class devil_server_user implements Runnable
public devil_server_user (int uid){this.uid=uid;};
public int uid;
public Socket kanal;
public InetAddress ip;
public InputStream streamin;
public OutputStream streamout;
public BufferedReader bufferind;
public PrintWriter printout;
public String lastuserin;
public String userinput;
public String sip;
public int isadmin;
//variable types concerning mysql database connectivity
public Statement stmt;
//public Statement rstmt;
public ResultSet rs;
public Connection conn;
     public void run()
          try {
     System.out.println("Listening on port 5555");
     System.out.println("Waiting for clients");
     kanal = devil_server.skanal.accept();
     devil_server.uid++;
     ip = kanal.getInetAddress();
     sip = ip.toString();
     sip = sip.replace("/","");
     isadmin = 0;
     if(sip.equals("127.0.0.1"))
     isadmin = 1;
     } catch (Exception ex) {
     ex.printStackTrace();
     try {
     System.out.println("Incomming request: "+ ip);
     streamin = kanal.getInputStream();
     System.out.println("Input ready");
     streamout = kanal.getOutputStream();
     System.out.println("Output ready");
     devil_server.users.set(this.uid, printout = new PrintWriter(streamout));
     printout = (PrintWriter)devil_server.users.get(this.uid);
     bufferind = new BufferedReader(new InputStreamReader(streamin));
     catch (IOException e){
     e.printStackTrace();
    try { 
     Class.forName("com.mysql.jdbc.Driver").newInstance();
     conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/Java?user="+devil_server.user+"&password=s"+devil_server.pass);
     stmt = conn.createStatement();
     stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
     } catch (Exception e) {
     e.printStackTrace();
     //String request = bufferind.readLine();
     //System.out.println("message from "+ip+" : "+request);
     //printout.flush();
//forbindelse
try {
     userinput = (String)bufferind.readLine();
     } catch(Exception e) {
     e.printStackTrace();
     while(!userinput.startsWith("/name"))
     try {
          userinput = (String)bufferind.readLine();
               } catch(Exception e) {
     e.printStackTrace();
     try
     stmt = conn.createStatement();
     stmt.executeUpdate("INSERT INTO devilchat_users (ip, username, isadmin) VALUES('"+sip+"',' "+userinput.substring(6)+"','"+isadmin+"')");
     new Thread(new devil_server_broadcast("/say "+userinput.substring(6)+" has joined devilchat")).start();
     devil_server.usernames.set(this.uid, userinput.substring(6));
     printout.println("/knock"); //knocks to the client
     printout.flush();
     userinput = (String)bufferind.readLine();
          } catch(Exception e) {
     e.printStackTrace();
     while(!userinput.startsWith("/knock"))
     try {
     userinput = (String)bufferind.readLine(); //waiting for client to knock back
          } catch(Exception e) {
     e.printStackTrace();
     printout.println("/ready"); //tells client it's ready to read userinput
     printout.flush();
     int spoken = 0;
     System.out.println(devil_server.usernames.get(this.uid)+": has connected");
     new Thread(new devil_server_usercheck()).start();
//starter l�kke som checker for nye input fra useren
     while(true)
     try{
          userinput = (String)bufferind.readLine();
          if(!userinput.equals(lastuserin))
          if(userinput.startsWith("/name"))
          stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          rs = stmt.executeQuery("SELECT * FROM devilchat_users WHERE uid='"+this.uid+"'");
          rs.absolute(this.uid);
          String oldname = rs.getString("username"); // get old name from database and save it in a string before applying the new name
          stmt = conn.createStatement();
          stmt.executeUpdate("UPDATE devilchat_users set username='"+userinput.substring(6)+"' WHERE uid ='"+this.uid+"'");
          //start a broadcast to tell the name has changed
          new Thread(new devil_server_broadcast("/namechange *** "+oldname+" has changed their name to "+userinput.substring(6)+" ***")).start();
          //change the username in the vector containing usernames
          devil_server.usernames.set(this.uid, userinput.substring(6));
          //start a new listcheck so the list can be updated
          new Thread(new devil_server_usercheck()).start();
          else if(userinput.startsWith("/say"))
          stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          rs = stmt.executeQuery("SELECT * FROM devilchat_users WHERE uid='"+this.uid+"'");
          rs.absolute(this.uid);
          String sname = rs.getString("username");
          String say1 = userinput.substring(6);
          userinput = "/say "+sname+": "+say1;
          spoken++;
          stmt = conn.createStatement();
          stmt.executeUpdate("UPDATE devilchat_users set spoken='"+spoken+"' WHERE uid ='"+this.uid+"'");
          new Thread(new devil_server_broadcast(userinput)).start();
          else if(userinput.startsWith("/quit"))
          stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          rs = stmt.executeQuery("SELECT * FROM devilchat_users WHERE uid='"+this.uid+"'");
          rs.absolute(this.uid);
          String name = rs.getString("username");
          printout.println("/quit "+name+" has left devilchat"); //tells client it's ready to read userinput
          printout.flush();
          devil_server.usernames.set(this.uid, "user");
          devil_server.users.set(this.uid, "buffer");
          new Thread(new devil_server_broadcast("/quit "+name+" has left devilchat")).start();
          conn.close();
          kanal.close();
          break;
          lastuserin = userinput;
     catch(Exception e) {
     e.printStackTrace();
}this is the full exception handling
java.sql.SQLException: Access denied for user 'Java'@'localhost' (using password
: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:894)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3808)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1256)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2032)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:283)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at devil_server_user.run(devil_server_user.java:71)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at devil_server_user.run(devil_server_user.java:97)
at java.lang.Thread.run(Unknown Source)
I have tried the org driver too and I have tried (url, user, pass) and (url?user=user&password=pass)
Edited by: Angelwinged_Devil on Mar 13, 2008 6:04 AM

well it's pretty weird, because I'm trying to make some kind of pattern with the install file I made, although... the install file works and looks like this
import java.io.*;
import java.net.*;
import java.sql.*;
public class install
    public static void main(String[] args) {
        try {
            // The newInstance() call is a work around for some
               //older java implementations
               //org.gjt.mm.mysql.Driver or com.mysql.jdbc.driver
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
        } catch (Exception ex) {
            ex.printStackTrace();
          try {
          System.out.println("write the user used to access the mysql database with Devil Chat");
          String user = Keyboard.readString(); //read mysql username from keyboard
          System.out.println("write the password used to access the mysql database with Devil Chat");
          String pass = Keyboard.readString(); //read password for user from keyboard
          Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/mysql", user, pass);
          Statement stmt = conn.createStatement();
          stmt.executeUpdate("CREATE DATABASE IF NOT EXISTS Java");
          System.out.println("Database has been created");
          Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/Java", user, pass);
          Statement nstmt = con.createStatement();
          nstmt.executeUpdate("CREATE TABLE IF NOT EXISTS devilchat_users ("+
          "uid int NOT NULL AUTO_INCREMENT, PRIMARY KEY(uid), "
          +"username varchar(25), isadmin bool, spoken int, ip varchar(15))");
          System.out.println("Table has been created");
          con.close();
          conn.close();
               } catch (SQLException ex) {
    // handle any errors
    System.out.println("SQLException: " + ex.getMessage());
    System.out.println("SQLState: " + ex.getSQLState());
    System.out.println("VendorError: " + ex.getErrorCode() + "\n");
}

Similar Messages

  • Error...java.sql.SQLException:Access denied for user

    Hi,
    I am getting the following error message while connecting with the MySQL .(O/S :Sun OS 5.6)
    Error.....java.sql.SQLException: Invalid authorization specification: Access denied for user: 'some_user&password@localhost' (Using password: NO)
    Note that i have given all permission to the user using,
    GRANT ALL PRIVILEGES .......................
    The code i have used to connect with the database is,
    import java.io.*;
    import java.sql.*;
    class test
    public static void main(String a[])
    try
    Connection con;
    Statement stmt;
    ResultSet rs;
    Class.forName("org.gjt.mm.mysql.Driver");
    con=DriverManager.getConnection(jdbc:mysql://localhost/db_name?user=some_user&password=some_pass");
    stmt=con.createStatement();
    //do something with resultset
    catch(Exception e)
    System.out.println("Exception in second try.."+e);
    plese guide me on this problem to solve.
    Thankz,
    Bala.

    Hi friends...
    I've read the last post...
    The problem that I have is as follow....
    1. I have installed on my machine MySQL 5.0 Server running
    1.1 I have a database called "base1"
    1.2 User "root", password "works"
    1.3 I have the following sentence to connect it using JDBC
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/base1", "root", "works");
    More notes:
    - I use the JDBC 5.0
    - My Machine is a Windows XP SP2 Pentium 3.0 512Mb
    and it connects����
    but I have this environment to develop applications, now that I want to connect to Production Environment happens the following:
    2 The Production database is mounted on a Linux Server with MySQL 3.2.
    2.1 I change the sentences as follow:
    Connection con = DriverManager.getConnection("jdbc:mysql://192.168.0.7/base1", "user", "password");
    2.3 But a message appears when I run the Java Program:
    java.sql.SQLException:Access denied for user: '[email protected]' (Using password: YES)
    2.4 As you can see it changes the IP Address...
    More notes:- I have the MySQL Query Browser and I got connection.
    - The IP that display the Error Message is my Second IP configurated on my Network Properties.
    - Server is a Pentium 4 3.0 GHz 2Gb Linux Red Hat 3.0
    I leave this case for the spider... I hope that somebady has the solution.
    What is the problem? Why the JDBC doesn't respect the IP that I wrote.

  • : Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'adobe'@'localhost' (using password: YES))

    hi all can anyone help me i am geting Exception while starting LCES server
    : Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'adobe'@'localhost' (using password: YES))

    hi all can anyone help me i am geting Exception while starting LCES server
    : Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'adobe'@'localhost' (using password: YES))

  • Oracle GoldenGate Veridata Exception (access denied)

    Hello all,
    I have recently installed weblogic 12.1.3 and Goldengate Veridata server on a Linux box successfully, and then successfully created a domain server to administer Veridata. After opening Veridata Web console with the newly created User from Weblogic Server that has all the privileges of veridata administration, in the new connection wizard,  veridata shows following exception.
    OGGV-00184: Error message: com.goldengate.wallet.WalletException: OGGV-80002: Put credential for CONN..IRIS2 failed: access denied ("oracle.security.jps.service.credstore.CredentialAccessPermission" "context=SYSTEM,mapName=VERIDATA,keyName=CONN.IRIS2" "write").

    You have the wrong java version which i suppose is java8 which is not supported for 12c yet so downgrade to java 7. Not sure what flavour your OS is I used this How to Install Java 7 (Jdk 7u75) on CentOS/RHEL 7/6/5 and downgraded java restarted my weblogic and everything worked as expected.

  • Sql server Access denied

    I am executing exec xp_cmdShell command to copy my backup file to another machine over network and getting Access Denied error. However from command prompt when I try dos command to copy, it does with no pain. The destination folder is shared and given full permission. Can any body help plz. I am doing a production server backup.
    Is there any setting witin SQL server I got to make ?
    Thanks in advance.

    Does any body has any answer for me ??????

  • Access Denied error (code 5)

    Hi
    I am using server 2008 r2 sp1 while installing any windows update or my sql I am getting error code 5 access denied
    and i am installing with Admin ID. What can be the reason?

    Checked this ? 
    https://social.technet.microsoft.com/Forums/en-US/522a1177-22eb-458b-a113-d1958e0b991e/sql-express-access-denied-error-code-5?forum=sqlexpress
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Web Start - access denied?

    Hi!
    I'm trying to launch my desktop app with webstart
    Webstart loads ... my apps full screen GUI displays fine ... but then webstart throws the error:
    Access Control Exception : access denied
    Where do I change security permissions ? in my app? in webstart?
    Thanks!

    In the JNLP file.
    Or use the JNLP apis for file/socket/other restricted stuff.

  • Sql agent job getting file access denied error

    I'm not sure if this question belongs in this forum. Please move it if you want to.
    Here is my question. I have an ssis package that is running into an error at the file system task trying to move a file. The package is deployed to the catalog and I am running the package using the stored procedure
    [SSISDB].[catalog].[start_execution] @execution_id
    When I execute this stored proc in Management Studio while logged in under a sysadmin, everything works fine. But when I call the same TQL in SQL Agent job, I get a file access denied error. This has something to do with the id that is getting used
    to run the package and I am not sure how to track that down. Any help would be appreciated.
    I've check the windows permission on both the id that is running the SQL Agent and SQL SSIS Service. Both seem to have the right windows permission.

    Please see:
    http://support.microsoft.com/kb/918760

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • Java.io.File causes "access denied" exception in a signed applet

    Hi,
    New to these forums and not entirely where it's appropriate to post this issue, so I'll stick it here for now until told otherwise.
    The problem:
    My applet throws the following exception.
    INFO: Exception Message: access denied (java.io.FilePermission C:\Some Dir With Spaces\AnotherDir\FinalDir read)
    The psuedo-code:
    java.io.File RootPath = new java.io.File( "C:\" );
    private boolean doesSubdirectoryExist(String directory) {
            boolean mResult = false;
            try
                java.io.File tmpPath = new java.io.File( RootPath.toString() + java.io.File.separatorChar + directory );
                mResult = tmpPath.isDirectory();
                tmpPath = null;
            catch (Exception e)
                ... error handling code
            return mResult;
    private void btnCheckPathActionPerformed(java.awt.event.ActionEvent evt) {
            ....some other stuff....
            doesSubdirectoryExist(.. a text field value from the GUI form..);
            ....some other stuff....
    }                                       The conditions:
    1) The applet is signed.
    2) The applet runs fine in the AppletViewer.
    3) I am using JDK1.5.0_09.
    4) When I click the button the event handler is tied to, it works correctly the first time.
    5) If I click a second time, with the same value in the text field (i.e. testing for the same subdirectory again) I get the exception error.
    I'm pulling my hair out trying to figure this one out. If it were a security issue with the applet running from a browser, why does it work the first time?
    Am I failing to release some lock that creating a java.io.File instance creates?
    I would appreciate any help.

    I've identified the issue. I was attempting to access the filesystem from two different thread and/or contexts.
    It seems that if I use the SwingWorker class from https://swingworker.dev.java.net/ to perform background tasks in the Worker thread, I don't get the security privileges required to modify the filesystem. Even though I have signed the jar correctly.
    However I can access the filesystem quite happily from the Event Dispatcher thread. If my jar is signed correctly.
    So, I have the following questions:
    1. Why doesn't SwingWorker worker threads get the same security context as the event dispatcher thread?
    2. Is there anyway I can give the worker thread the necessary security privileges?
    3. Is there anyway to do this without having to write my own thread handling code and creating my own thread pools?
    Message was edited by:
    Fidotas
    Message was edited by:
    Fidotas

  • Java.sql.SQLException: Cannot obtain connection after 3600 seconds. , Exception = Access not allowed

    Using Weblogic Platform 7.0 (installed from platform700_win32.exe),
    Running a BPM Doamin(WLIDomain with BPM only).
    When I try to access my entity bean(CMP), the following exception is getting thrown.
    I have seen a similar post in here, but the answer to that post, which says to
    provide ACL. does not apply quite well my scenario.
    To do this, I right clicked on the connection pool and selected define Ploicy..
    It shows two options
    RealmAdapterAuthorizer and DefaultAuthorizer; On DefaultAuthroizer i specified
    role accessing the resource would be "everyone". - restarted the server - but
    still the same error.
    Please suggest a solution if any. Do i have to get some service pack for this?
    TIA
    Ranjith.

    We have never seen a case yet where this was not a permissions problem.
    Do you have a fileRealm.properties file as part of your configuration?
    "Ranjith" <[email protected]> wrote in message
    news:3f0fdeb3$[email protected]..
    >
    java.sql.SQLException: Cannot obtain connection after 3600 seconds. ,Exception
    = Access not allowed
    java.sql.SQLException: Cannot obtain connection after 3600 seconds. ,Exception
    = Access not allowed
    atweblogic.jdbc.jts.Connection.wrapAndThrowSQLException(Connection.java:701)
    atweblogic.jdbc.jts.Connection.getOrCreateConnection(Connection.java:623)
    atweblogic.jdbc.jts.Connection.prepareStatement(Connection.java:133)
    atweblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.ja
    va:139)
    atweblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:81
    atservice.samplemgt.v1_0.ejb.entity.BanksampletypeCMP_ckv0ao__WebLogic_CMP_RDB
    MS.ej
    bFindAll(BanksampletypeCMP_ckv0ao__WebLogic_CMP_RDBMS.java:873)
    at java.lang.reflect.Method.invoke(Native Method)
    atweblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersi
    stenceManager
    java:300)
    atweblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.
    java:715)
    atweblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.
    java:688)
    atweblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:47
    6)
    at ...

  • Java.security.Access denied exception

    hello all,
    iam new to java please help me .
    my program has thrown the exception:
    java.security.AccessControlException: access denied (java.io.FilePermission F:\
    read)
    using applets a dynamic jtree should be displayed.
    when a user clicks a node a file should be retrived and display the directories and files in it.
    the program code is:
    public void mouseClicked(MouseEvent me)
    TreePath tp = Tree.getPathForLocation(me.getX(),me.getY());
    String dirname = tp.toString();
    File f =new File("F:\\");
    int w =st.length();
    String y = st.substring(1,w-1);
    File f2 = new File(y);
    String v[] = f2.list90;
    for(int u=0;u<v.length;u++)
    System.out.println(v); //checking atleast o/p may display in command prompt.
    any idea reply soon
    it's very urgent.
    usha

    This forum is specific to the Message Queue product ....
    for general questions, you may want to start at the "new to java" forum
    http://forum.java.sun.com/forum.jspa?forumID=54

  • [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

    Hi, I've seen questions about this error posted elsewhere but I'm not sure if the same issues applied.
    I'm trying to connect to SQL Server from a VBA macro in excel. I've managed to do this with the code below where my query is return to cells in my active worksheet but for another query I want to run the data to be return is too large for Excel to handle
    and so I'd like to save it as a .csv file but using the second example of my code I get the message "[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied". Since I have access to this database from the first example
    of the code, I assume my conn.ConnectionString line of code is letting me down.
    Can anyone help me please?
    'Code to return data to worksheet'
    Sub macro2()
    With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
            "ODBC;DSN=SQLRA - OPENBET;UID=user1;Trusted_Connection=Yes;APP=Microsoft Office 2013;WSID=pdfdf3001;DATABASE=open;Network=DBMSS" _
            ), Array("OCN;Address=SQLRA_DB,55455;ApplicationIntent=READONLY;")), _
            Destination:=Range("$BG$1")).QueryTable
            .CommandText = Array( _
            "select  A.ev_oc_id, B.ev_mkt_id, A.ev_id, D.start_Time, Upper(Replace(A.[desc],'|','')) , A.result, COALESCE(A.sp_num, A.lp_num) , ", _
            "COALESCE(A.sp_Den, A.lp_Den) from open.reporting.tevoc A, open.reporting.tevmkt B, open.reporting.tevocgrp C, open.reporting.tev D ", _
            "where  A.ev_mkt_id = B.ev_mkt_id and B.ev_oc_grp_id = C.ev_oc_grp_id and D.ev_id = A.ev_id and Upper(Replace(D.[desc],'|','')) = 'home' and upper(B.name) = '|today|' and D.ev_type_id in (264, 289) and D.ev_class_id = 49
    and D.start>= '" & Year & "-" & Month & "-" & Day & "'" _
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = True
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .PreserveColumnInfo = True
            .ListObject.DisplayName = "Table_Query_from_SQLRA___OPEN_1"
            .Refresh BackgroundQuery:=False
        End With
    End Sub
    'Code that produces error'
    Sub macro1()
    Dim conn As ADODB.Connection
    Set conn = New ADODB.Connection
    Dim testSQL As String
    Dim qd As DAO.QueryDef
    Dim openbetdb As Database
        conn.ConnectionString = "driver={SQL Server}; server= sqlra_db;uid=user1;APP=Microsoft Office 2013;WSID=pdfdf3001;database=openbet"
        conn.Open
        testSQL = "SELECT * FROM open.reporting.TevType where ev_class_id = 49 and ev_type_id in(289,330,518,13492);"
        Set qd = Db.CreateQueryDef("tmpExport", testSQL)
        DoCmd.TransferText acExportDelim, , "tmpExport", "C:\\export.csv"
    End Sub

    Hello,
    Are you connect to remote SQL Server? If so,
    please make sure the target SQL Server is running and is listening on appropriate protocols. Please take a look at the following article about general steps to troubleshoot
    SQL connectivity issues:
    http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • SQL Query works in MS Access but caused SQL exception

    Hi all,
    I've got this query that works if I run it in MS Access but caused an SQL Exception if I run in my Java programme.
    The query
    SELECT Count(*) AS countPlayerMax FROM (SELECT Count(*) AS countSent, sent.mobileno FROM sent WHERE (((sent.date_sent) Between #2002-3-1# And #2002-3-8#)) GROUP BY sent.mobileno HAVING (((Count(*))>100)))
    The exception is
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    I've done nested queries before but this one doesn't work. Any ides why??
    thanks

    Thanks for your suggestion
    I tried it but it still gives the same error, now the SQL looks like this
    SELECT Count(*) AS countPlayerMax FROM (SELECT Count(*) AS countSent, sent.mobileno FROM sent WHERE sent.date_sent Between #2002-3-1# And #2002-3-8# GROUP BY sent.mobileno HAVING Count(*)>100)
    the exception is the same
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

  • [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    I using SQL 2000 on Server 2012 in named instance. when i connect locally, it's ok, but when try to connect from network it generates error [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    Hi Sayed Abdul Latif,
    As other post, SQL Server 2000 was out of support since April,2013. You can try to install SQL Server 2005 or later version. In addition, since the issue regards SQL Server Data Access. I will help you post the question in the related forums. It is appropriate
    and more experts will assist you.
    According to your description, you can only connect to SQL Server locally, I recommend you check if the TCP/IP and Named Pipes are enabled in SQL Server Configuration Manager. And the SQL Server is set to allow remote connection. Then restart the SQL Service
    and check if you can connect to SQL Server remotely.
    Additionally, we also need to verify if the SQL Server named instance is in a cluster, and connect to it by using the "servername\instancename" syntax, then you receive the above error message. If yes, you have to hardcode the TCP port or the Named Pipe
    of the SQL Server named instance. For more information, you can review the following article.http://support.microsoft.com/kb/888228/en-us
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

Maybe you are looking for

  • Using an HDMI splitter.....

    Hi folks, i have a powerpoint presentation that I am needing to show, but am having to use an HDMI splitter to goto two projectors. It recognises the splitter, but either get nothing, or just digital static.  I can go directly to either of the two TV

  • Console fails on solaris 8

    Hello, I installed DS50 on a solaris 8 machine. When I start the console I get the following messages: Font specified in font.properties not found [-b&h-lucida sans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1] Font specified in font.properties not fo

  • Labview 2011 application crashes from time to time

    Hi together, from time to time my LV application crashes. This happens in different stages of the program. I use some ext. DLLs written in C, some simple IO hardware and some serial communications with ext. hardware. My feeling is that it has s.th. t

  • Smart Folders to find files with certain priviledges

    How do I set up a smart folder to display files that have only read&write privileges within a directory.

  • Adding servlet entry in web.xml of j2ee engine

    Hi , I want a servlet to be loaded on startup of the j2ee engine SAP WAS which is basically flex based (MessageBrokerServlet).  The init param for the servlet is not accessible or cannot be initialized in init method of the servlet using the servletc