我正在尝试创建一个新的表空间(我使用javafx),我在控制器中编写命令,如下所示:
我的代码
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package projetoracle;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
public class FXMLcreate_permanentController implements Initializable {
@FXML
private TextField file;
@FXML
private TextField size;
@FXML
private Button valider;
@FXML
private Button quitter;
@FXML
private TextField nom;
@FXML
private ComboBox<Label> accessible;
@FXML
private ComboBox<Label> typefile;
@FXML
private ComboBox<Label> segment;
@FXML
private ComboBox<Label> extension;
@FXML
private ComboBox<Label> journalisation;
@FXML
private ComboBox<Label> unite;
@FXML
private TextField extent;
@FXML
private ComboBox<Label> size3;
@FXML
void handleButtonActionquitter(ActionEvent event) {
}
@FXML
void handleButtonActionvalider(ActionEvent event) {
String createQuery;
String co = "'";
createQuery ="CREATE"+ " " +typefichier()+ " " +"TABLESPACE"+ " " +nom.getText().toString()+"DATAFILE"+ " "+ co +file.getText().toString()+ ".dbf"+ co + " "+"SIZE" +size.getText().toString()+ " " +tailleall()+ " " +allocate()+ " " +auto()+ " " +journalisation()+ " " +online();
try{
DBUtil.dbExecuteUpdate(createQuery);
System.out.println("Succées d'ajout");
}
catch (Exception e){
System.out.println("erreur!");
}
}
public String typefichier()
{
if (typefile.getSelectionModel().getSelectedItem().getText().toString().equals("Smallfile"))
return "SMALLFILE";
else
return "BIGFILE";
}
public String online()
{
if (accessible.getSelectionModel().getSelectedItem().getText().toString().equals("Online"))
return "ONLINE";
else
return "OFFLINE";
}
public String allocate()
{
if (extension.getSelectionModel().getSelectedItem().getText().toString().equals("Autoallocate"))
return "EXTENT MANAGEMENT LOCAL AUTOALLOCATE";
else
return "EXTENT MANAGEMENT LOCAL UNIFORM SIZE " + extent.getText() +taillealle();
}
public String tailleall()
{
if (unite.getSelectionModel().getSelectedItem().getText().toString().equals("Ko"))
return "K";
else if (unite.getSelectionModel().getSelectedItem().getText().toString().equals("Mo"))
return "M";
else
return "G";
}
private String journalisation()
{
if (journalisation.getSelectionModel().getSelectedItem().getText().toString().equals("logging"))
return "LOGGING";
else
return "NOLOGGING";
}
private String auto()
{
if (segment.getSelectionModel().getSelectedItem().getText().toString().equals("Auto"))
return "SEGMENT SPACE MANAGEMENT AUTO";
else
return "SEGMENT SPACE MANAGEMENT MANUAL";
}
String taillealle(){
if (size3.getSelectionModel().getSelectedItem().getText().toString().equals("Ko"))
return "K";
else if (size3.getSelectionModel().getSelectedItem().getText().toString().equals("Ko"))
return "M";
else
return "G";
}
@Override
public void initialize(URL url, ResourceBundle rb) {
unite.getItems().add(new Label("Ko"));
unite.getItems().add(new Label("Mo"));
unite.getItems().add(new Label("Go"));
accessible.getItems().add(new Label("Online"));
accessible.getItems().add(new Label("Offline"));
typefile.getItems().add(new Label("Smallfile"));
typefile.getItems().add(new Label("Bigfile"));
segment.getItems().add(new Label("Auto"));
segment.getItems().add(new Label("Manual"));
extension.getItems().add(new Label("Autoallocate"));
extension.getItems().add(new Label("Uniform"));
journalisation.getItems().add(new Label("No logging"));
journalisation.getItems().add(new Label("logging"));
size3.getItems().add(new Label("Ko"));
size3.getItems().add(new Label("Mo"));
size3.getItems().add(new Label("Go"));
}
}
我认为这是正确的但是当我跑步时我有这个问题
Problem occurred at executeUpdate operation : java.sql.SQLSyntaxErrorException: ORA-02180: invalid option for CREATE TABLESPACE
我做错了什么? 任何帮助将不胜感激 。