JTextField to database

Hello, Guys! I need your advice.
I have some troubles with binding JTextField to my database (MSSQL Server). I need to write text from a JTextfield to the database when users click a jbutton. There are no problems with the database connection and the code works if I put any constant in the line "String table = "INSERT INTO Department " + "VALUES ('"+maxid+"',"+Dptmnt.getText()+")";" istead of "+Dptmnt.getText()+"