|
|
|
помогите с JAVA
|
|||
|---|---|---|---|
|
#18+
public class JDBC { static Connection con = null; static String user = "root"; static String password = "nazarik"; static String url = "jdbc:mysql://localhost:3306/nazarius"; static final String crttbl = "CREATE TABLE New Nazarik"+ "(id INT (20) NOT NULL AUTO_INCREMENT,"+ "first_name VARCHAR (255),"+ "last_name VARCHAR(255),"+ "age INT (3),"+ "PRIMARY KEY ( id ))"; public static void main(String[] args) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException { Class.forName ("com.mysql.jdbc.Driver"); try { con = DriverManager.getConnection(url, user, password); if (con == null) System.out.println("Connection imposible"); if (con != null) System.out.println("Connection has executed"); Statement stm = con.createStatement(); stm.executeUpdate(crttbl); }catch (Exception e){System.out.println(e.getMessage());} con.close(); кидает You have an error in your SQL syntax..........а idea на таблице подсказывает No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter). less... (Ctrl+F1) Prompts one to create a data source if there is none. перепробовал по разному,всё впустую ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.08.2015, 16:42:40 |
|
||
|
помогите с JAVA
|
|||
|---|---|---|---|
|
#18+
parodentкидает You have an error in your SQL syntax..........Самое интересное спрятали... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.08.2015, 17:07:17 |
|
||
|
помогите с JAVA
|
|||
|---|---|---|---|
|
#18+
miksoft, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Nazarik(id INT (20) NOT NULL AUTO_INCREMENT,first_name VARCHAR (255),last_name V' at line 1 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.08.2015, 17:24:21 |
|
||
|
помогите с JAVA
|
|||
|---|---|---|---|
|
#18+
parodentCREATE TABLE New NazarikНазвание таблицы из двух слов должно экранироваться специальными кавычками “`”. http://dev.mysql.com/doc/refman/5.5/en/identifiers.html The identifier quote character is the backtick (“`”) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.08.2015, 17:35:42 |
|
||
|
|

start [/forum/topic.php?fid=47&msg=39021916&tid=1832862]: |
0ms |
get settings: |
8ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
44ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
35ms |
get tp. blocked users: |
1ms |
| others: | 201ms |
| total: | 319ms |

| 0 / 0 |
