« Return to Thread: dangerous import java.sql._

Re: dangerous import java.sql._

by Tony Morris-4 :: Rate this Message:

Reply to Author | View in Thread

Good job, then we shall reveal the problem for all!

The import causes the main method to use java.sql.Array thus making it
an invalid main method for execution.

turicum wrote:

> thank you for the prompt reply!
> everything's fine now :)
> Alex
>
>
> Tony Morris-4 wrote:
>  
>> I shan't spoil it for you, but I shall give ye a hint.
>>
>> When one alters Array for the word scala.Array then all is well.
>>
>> turicum wrote:
>>    
>>> Hi everybody!
>>>
>>> Yet another simple and mysterious problem: with the "import" statement,
>>> running the code will generate a "Exception in thread "main"
>>> java.lang.NoSuchMethodError: main". Removing the "import" solves the
>>> problem. What am I missing? Changing the name of the object does not
>>> modify
>>> the outcome. Thanks!
>>>
>>> import java.sql._ // remove this line to get rid of the error msg
>>>
>>> object Sqltest {
>>> def main(args: Array[String]) {
>>>  print("OK")
>>> }
>>> }
>>>
>>>
>>>  
>>>      
>> --
>> Tony Morris
>> http://tmorris.net/
>>
>>
>>
>>
>>    
>
>  

--
Tony Morris
http://tmorris.net/


 « Return to Thread: dangerous import java.sql._