Search Results

Search found 2 results on 1 pages for 'sin5k4'.

Page 1/1 | 1 

  • Reading a file over a network path

    - by Sin5k4
    I have this weird issue,when I use > File FileToRead = new File("\\\\MYSERVER\\MYFOLDER\\MYFOLDER\\MYPICTURE.JPG"); to read a file over a network,all I get is a null pointer exception.Normally a local path works with this,but when on a network path,I just couldn't manage to get it to work.Any ideas? PS:oh and my network connection seems to work,no issues when accessing data in windows explorer... More of the code: File FileToRead = new File("file://DOKSERVICE/Somefolder/ProductImage/01001.JPG"); // File FileToRead = new File("c:\\dog.jpg"); local test BufferedImage image = ImageIO.read(FileToRead); BufferedImage resizedimage = new BufferedImage(260, 260,BufferedImage.TYPE_INT_RGB ); Graphics2D g = resizedimage.createGraphics(); g.drawImage(image, 0, 0, 260, 260, null); g.dispose(); picture.setIcon(new ImageIcon(image));

    Read the article

  • Using calculated fields over and over again with a new table

    - by Sin5k4
    I'm fairly new to SQL and i had to do some calculations using a table.Imagine we have a table with fields : ID - Name - Val1 - Val2 ; Lets say i want to add up 2 values and add it to my query result.I can do that easily with a sub query such as: select val1+val2 as valtotal,* from my table. Now if i want to do some more process on valtotal, i use a derived table such as; select valtotal*3 as ValMoreCalculated,* from (select val1+val2 as valtotal,* from my table) AS A A bit more code maybe?? select ValMoreCalculated/valtotal as ValEvenMoreCalc ,* from (select valtotal*3 as ValMoreCalculated,* from (select val1+val2 as valtotal,* from my table) AS A)AS B So if i want to do more calculations with the ValMoreCalculated do i have to go through another derived table? Name it as B for example? Is there an easier way to achieve this in SQL? PS:the title is a bit off i know,but couldn't figure out what to name it :P

    Read the article

1