B4J Question jNxtReportsB4J: Connecting to mysql

focus330

Member
Licensed User
Longtime User
Hi

I have no success connecting to MySql trying code based on NextReportsDemo.

B4X:
[CODE]    
'replace this by your database driver class name
    'driverclass="net.sourceforge.jtds.mysql.Driver"
    driverclass="com.mysql.jdbc.Driver"

        'replace this by applicable url for your database
    'I use IP instead of server name. For some reason, in my tests with SQL SERVER, when I used server name, it would not not work on MACs

    url="jdbc:mysql://localhost:3306/scadabr;user=root;password=mypwd"

   
    'Initialize input list and add necessary arguments in the order shown below
    inputlist.initialize
    inputlist.Add(inlocation)
    inputlist.add(repin)
    inputlist.add(repout)
    inputlist.add(reptype)
    inputlist.add(driverclass)
    inputlist.add(url)
    'Now add your parameters - if any
    'First, the parameter name - as it was defined in NextReports
  '  inputlist.add("IdParam") 'The parameter name is IdParam
    'Then, your parameter value
 '   inputlist.add(13)
    'You can add as many parameters as necessary


    'Run the report and export the output report file
    repexec.reportPrepAndRun(inputlist)

    'Show the output report file
    fx.ShowExternalDocument(File.GetUri(File.DIRAPP, repout & "." & reptype))
[/CODE]


The error reported is :

java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO).

How to write a correct Url parameter ?

Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
Try
B4X:
dim jdbcurl as String = $"jdbc:mysql://localhost:3306/scadabr?user=root&password=mypasswd"$)
 
Upvote 0
Top