본문 바로가기

[Recoeve.net]

Exception: java.sql.SQLException: java.time.LocalDateTime to SQL type

반응형
# Exception: java.sql.SQLException: java.time.LocalDateTime to SQL type
Recoeve.net 에서 일어난 에러를 해결해 봅시다.
## PH
  • 2023-05-29 : First posting.
## COTD ## TOC ## Error | Exception ``` Exception: java.sql.SQLException: Cannot convert class java.time.LocalDateTime to SQL type requested due to java.lang.ArrayIndexOutOfBoundsException - Index 4 out of bounds for length 4 java.sql.SQLException: Cannot convert class java.time.LocalDateTime to SQL type requested due to java.lang.ArrayIndexOutOfBoundsException - Index 4 out of bounds for length 4 at recoeve.db.RecoeveDB.checkAuthToken(RecoeveDB.java:345) SQLState: S1000 Error Code: 0 Message: Cannot convert class java.time.LocalDateTime to SQL type requested due to java.lang.ArrayIndexOutOfBoundsException - Index 4 out of bounds for length 4 Cause: java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4 java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4 at recoeve.db.RecoeveDB.checkAuthToken(RecoeveDB.java:345) ```/ ## MySQL: TABLE `AuthToken` 참조: , . ``` CREATE TABLE `AuthToken` ( `t` datetime NOT NULL #DATETIME: YYYY-MM-DD HH:MM:SS. , `ip` varchar(32) NOT NULL , `token` binary(128) NOT NULL #DEFAULT random_bytes(128) , `new` boolean NOT NULL DEFAULT true , PRIMARY KEY (`t`, `ip`) ); ```/ ## Time, now ``` PreparedStatement pstmtNow=con.prepareStatement("SELECT utc_timestamp();"); public String now() { String now=""; try { ResultSet rs=pstmtNow.executeQuery(); if (rs.next()) { now=rs.getString(1); } } catch (SQLException e) { err(e); } return now; // utc_timestamp() } ```/ ## RRA
  1. kipid's blog :: SQL (Structured Query Language) 을 배워보자
  2. kipid's blog :: Recoeve Database setup (0.1 version)
반응형