我想知道是否有一种“紧凑”的方式可以从 PostGreSQL 的列中删除最后 n 个字符。
我有一个以日期格式生成的列,格式如下:yyyy-MM-dd。
我更改了表格以使该列成为 varchar,替换了所有不必要的破折号,但我想不出一种快速可靠的方法来删除最后两个字符,因为我希望 varchar 仅显示 yyyyMM。
“快速可靠”是指不会要求我使用临时表的东西。
提前致谢
我知道这是一个奇怪的问题,但我需要一件事:我收到一个字符串作为http操作的结果.实际上,这个字符串包含一个像这样的字符串数组:
["Leon","Prova 2","TestData"]
Run Code Online (Sandbox Code Playgroud)
基本上我想将此字符串转换为ArrayList,因为我需要它用于适配器.这是java代码:
public class Archivio{
static ArrayList<String> titoli = new ArrayList<String>();
static ArrayList<String> art = new ArrayList<String>();
static String response, response2 = null;
HttpClient httpclient;
HttpPost httppost,httppost2;
List<NameValuePair> nameValuePairs,namePairs;
@SuppressLint({ "NewApi", "NewApi", "NewApi" })
Archivio() {
try {
StrictMode.ThreadPolicy policy = new
StrictMode.ThreadPolicy.Builder()
.permitAll().build();
StrictMode.setThreadPolicy(policy);
httpclient=new DefaultHttpClient();
httppost= new HttpPost("http://tripleleon.altervista.org/artiview2.php");
nameValuePairs = new ArrayList<NameValuePair>();
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//Esecuzione richiesta HTTP Post e ricezione risultato operazione
//response=httpclient.execute(httppost);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
response = httpclient.execute(httppost, responseHandler);
System.out.println("Response : " + …Run Code Online (Sandbox Code Playgroud) 我显然错过了一些东西,但我不知道是什么......
愚蠢的是,有多少小事让你变得疯狂而不是复杂的......
这是控制器的代码:
@RequestMapping(value = "/getClienteNomeCognome", method = RequestMethod.GET)
public ResponseEntity<List<Object>> getClienteNomeCognome(@RequestParam("nomeCliente") String nomeCliente,
@RequestParam("cognomeCliente") String cognomeCliente) {
List<Object> listaRisultati = new ArrayList<Object>();
try {
listaRisultati = serviziDocumentaleService.getClienteNomeCognome(nomeCliente, cognomeCliente);
} catch (Exception e) {
LOGGER.warn(String.format("Errore inatteso sulla chiamata del servizio: [%s]", e.toString()));
}
LOGGER.info(String.format("Avvio ricerca cliente con nome: %s, cognome: %s)", nomeCliente, cognomeCliente));
return new ResponseEntity<List<Object>>(listaRisultati, HttpStatus.OK);
}
Run Code Online (Sandbox Code Playgroud)
这是getClienteNomeCognome:
public List<Object> getClienteNomeCognome(String nome, String cognome) throws Exception {
try {
final RestTemplate restTemplate = new RestTemplate();
final String url = …Run Code Online (Sandbox Code Playgroud) 我只是为此而疯狂,但我找不到解决方案,所以我在这里寻求帮助。
我一直使用 Notepad++,但自从我更新到 Windows 10 后,它开始无法正常工作。
当我打开它时,N++ 需要很长时间(比如......很长时间)才能运行(同时它保持在“无响应”状态)。
当它最终解冻并且我打开一个文件时,没有显示任何文本但是如果我尝试复制某些内容并将其粘贴到其他地方它会正确执行所以我想这不是这些东西的编码问题.....
我已经多次尝试卸载 N++,清除硬盘上的所有文件,甚至删除注册表项,但是当我再次安装它时,没有任何变化......
我很绝望请帮助我!!!
android ×1
arraylist ×1
controller ×1
ide ×1
java ×1
notepad++ ×1
postgresql ×1
response ×1
resttemplate ×1
string ×1