B4J Question Is it possible to create mysql database with b4j?

I guess it depends on the Rights you gave to the Database for the User you are using.
If the user has the right it should work.
 
Upvote 0
what i am confusing in is the right parameter that i should use in Sql Initialize. in order to create a database

B4X: Copy
'is this a correct Parameter ?
sql.Initialize("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:"&dpPort&"/?characterEncoding=utf8")

i am not adding database in the parameter since i am not trying to connect to a Database instead iam trying to create one
 
Upvote 0
i confirm it is working as expected

i was confused here is the working example

B4X: Copy
Sub createdatabase
    
Dim sql As SQL


Try
    
sql.Initialize2("com.mysql.jdbc.Driver","jdbc:mysql://localhost:"&dpPort&"/?characterEncoding=utf8","root", "123")

Dim SQLQuery As String = "CREATE DATABASE anyname;"

sql.ExecNonQuery(SQLQuery)

sql.Close


Catch
Log(LastException)
End Try
    
    
End Sub

Thank you Guys .
 
Upvote 0
Back
Top